From: Kairui Song <ryncsn@gmail.com>
To: linux-mm@kvack.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
Hugh Dickins <hughd@google.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
linux-kernel@vger.kernel.org, Kairui Song <kasong@tencent.com>
Subject: [PATCH] mm/shmem: remove unnecessary restrain unmask of swap gfp flags
Date: Wed, 11 Feb 2026 22:33:23 +0800 [thread overview]
Message-ID: <20260211-shmem-swap-gfp-v1-1-e9781099a861@tencent.com> (raw)
From: Kairui Song <kasong@tencent.com>
The comment makes it look like copy-paste leftovers from
shmem_replace_folio. The first try of the swap doesn't always have a
limited zone.
So don't drop the restraint, which should make the GFP more accurate.
Signed-off-by: Kairui Song <kasong@tencent.com>
---
mm/shmem.c | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/mm/shmem.c b/mm/shmem.c
index eaaeca8f6c39..4f34dfa95a50 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -2043,14 +2043,8 @@ static struct folio *shmem_swap_alloc_folio(struct inode *inode,
struct shmem_inode_info *info = SHMEM_I(inode);
struct folio *new, *swapcache;
int nr_pages = 1 << order;
- gfp_t alloc_gfp;
+ gfp_t alloc_gfp = gfp;
- /*
- * We have arrived here because our zones are constrained, so don't
- * limit chance of success with further cpuset and node constraints.
- */
- gfp &= ~GFP_CONSTRAINT_MASK;
- alloc_gfp = gfp;
if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) {
if (WARN_ON_ONCE(order))
return ERR_PTR(-EINVAL);
---
base-commit: ad92386d5debbde551129dc85f0118f5a521388c
change-id: 20260211-shmem-swap-gfp-c68b9d73a90f
Best regards,
--
Kairui Song <kasong@tencent.com>
next reply other threads:[~2026-02-11 14:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-11 14:33 Kairui Song [this message]
2026-02-14 7:15 ` Baolin Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260211-shmem-swap-gfp-v1-1-e9781099a861@tencent.com \
--to=ryncsn@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=hughd@google.com \
--cc=kasong@tencent.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox