All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] mm/vmscan: take min_slab_pages into account when try to call shrink_node
@ 2022-04-25 11:21 Miaohe Lin
  0 siblings, 0 replies; only message in thread
From: Miaohe Lin @ 2022-04-25 11:21 UTC (permalink / raw)
  To: akpm; +Cc: ying.huang, hch, hannes, linux-mm, linux-kernel, linmiaohe

Since commit 6b4f7799c6a5 ("mm: vmscan: invoke slab shrinkers from
shrink_zone()"), slab reclaim and lru page reclaim are done together
in the shrink_node. So we should take min_slab_pages into account
when try to call shrink_node.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Cc: Huang Ying <ying.huang@intel.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
---
v3:
  This patch is pending verifying. Split it out to make it easier
  to move forward.
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index a2752e8fc879..1049f5324765 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -4718,7 +4718,8 @@ static int __node_reclaim(struct pglist_data *pgdat, gfp_t gfp_mask, unsigned in
 	noreclaim_flag = memalloc_noreclaim_save();
 	set_task_reclaim_state(p, &sc.reclaim_state);
 
-	if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages) {
+	if (node_pagecache_reclaimable(pgdat) > pgdat->min_unmapped_pages ||
+	    node_page_state_pages(pgdat, NR_SLAB_RECLAIMABLE_B) > pgdat->min_slab_pages) {
 		/*
 		 * Free memory by calling shrink node with increasing
 		 * priorities until we have enough memory freed.
-- 
2.23.0


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-04-25 11:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25 11:21 [PATCH v3] mm/vmscan: take min_slab_pages into account when try to call shrink_node Miaohe Lin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.