From: Kairui Song Date: Wed, 11 Feb 2026 14:33:23 +0000 (+0800) Subject: mm/shmem: remove unnecessary restrain unmask of swap gfp flags X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7498bddab9455b3750b655c27cdcc0a2c48af318;p=thirdparty%2Fkernel%2Fstable.git mm/shmem: remove unnecessary restrain unmask of swap gfp flags 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. Link: https://lkml.kernel.org/r/20260211-shmem-swap-gfp-v1-1-e9781099a861@tencent.com Signed-off-by: Kairui Song Reviewed-by: Baolin Wang Cc: Hugh Dickins Signed-off-by: Andrew Morton --- diff --git a/mm/shmem.c b/mm/shmem.c index b40f3cd48961..cfed6c3ff853 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2044,14 +2044,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);