linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: mask DIRECT_RECLAIM in kswapd
@ 2021-12-06  3:19 Huangzhaoyang
  2021-12-07  1:23 ` Andrew Morton
  2021-12-08  9:40 ` David Howells
  0 siblings, 2 replies; 4+ messages in thread
From: Huangzhaoyang @ 2021-12-06  3:19 UTC (permalink / raw)
  To: Andrew Morton, Zhaoyang Huang, linux-mm, linux-kernel

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

As the eg bellowing, using GFP_KERNEL could confuse the registered .releasepage
or .shrinker functions when called in kswapd and have them acting wrongly.Mask
__GFP_DIRECT_RECLAIM in kswapd.

eg,
kswapd
  shrink_page_list
    try_to_release_page
      __fscache_maybe_release_page
	...
         if (!(gfp & __GFP_DIRECT_RECLAIM) || !(gfp & __GFP_FS)) {
                 fscache_stat(&fscache_n_store_vmscan_busy);
                 return false;
         }

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index ef4a6dc..3b5c5e6 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4083,7 +4083,7 @@ static int balance_pgdat(pg_data_t *pgdat, int order, int highest_zoneidx)
 	bool boosted;
 	struct zone *zone;
 	struct scan_control sc = {
-		.gfp_mask = GFP_KERNEL,
+		.gfp_mask = GFP_KERNEL & ~__GFP_DIRECT_RECLAIM,
 		.order = order,
 		.may_unmap = 1,
 	};
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-12-08  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06  3:19 [PATCH] mm: mask DIRECT_RECLAIM in kswapd Huangzhaoyang
2021-12-07  1:23 ` Andrew Morton
2021-12-07  2:07   ` Zhaoyang Huang
2021-12-08  9:40 ` David Howells

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).