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 <kasong@tencent.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
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);