Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <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>

authored by

Kairui Song and committed by
Andrew Morton
7498bdda c5c48345

+1 -7
+1 -7
mm/shmem.c
··· 2044 2044 struct shmem_inode_info *info = SHMEM_I(inode); 2045 2045 struct folio *new, *swapcache; 2046 2046 int nr_pages = 1 << order; 2047 - gfp_t alloc_gfp; 2047 + gfp_t alloc_gfp = gfp; 2048 2048 2049 - /* 2050 - * We have arrived here because our zones are constrained, so don't 2051 - * limit chance of success with further cpuset and node constraints. 2052 - */ 2053 - gfp &= ~GFP_CONSTRAINT_MASK; 2054 - alloc_gfp = gfp; 2055 2049 if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) { 2056 2050 if (WARN_ON_ONCE(order)) 2057 2051 return ERR_PTR(-EINVAL);