Commit 7498bdda authored by Kairui Song's avatar Kairui Song Committed by Andrew Morton
Browse files

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: default avatarKairui Song <kasong@tencent.com>
Reviewed-by: default avatarBaolin Wang <baolin.wang@linux.alibaba.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c5c48345
Loading
Loading
Loading
Loading
+1 −7
Original line number Diff line number Diff line
@@ -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);