linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm:vmscan: fix inaccurate reclaim during proactive reclaim
@ 2023-07-07 10:32 Efly Young
  2023-07-07 19:09 ` Andrew Morton
  2023-07-11 15:28 ` Johannes Weiner
  0 siblings, 2 replies; 5+ messages in thread
From: Efly Young @ 2023-07-07 10:32 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel

With commit f53af4285d77 ("mm: vmscan: fix extreme overreclaim
and swap floods"), proactive reclaim still seems inaccurate.

Our problematic scene also are almost anon pages. Request 1G
by writing memory.reclaim will reclaim 1.7G or other values
more than 1G by swapping.

This try to fix the inaccurate reclaim problem.

Signed-off-by: Efly Young <yangyifei03@kuaishou.com>
---
 mm/vmscan.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index 9c1c5e8b..2aea8d9 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -6208,7 +6208,7 @@ static void shrink_lruvec(struct lruvec *lruvec, struct scan_control *sc)
 	unsigned long nr_to_scan;
 	enum lru_list lru;
 	unsigned long nr_reclaimed = 0;
-	unsigned long nr_to_reclaim = sc->nr_to_reclaim;
+	unsigned long nr_to_reclaim = (sc->nr_to_reclaim - sc->nr_reclaimed);
 	bool proportional_reclaim;
 	struct blk_plug plug;
 
-- 
1.8.3.1



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

end of thread, other threads:[~2023-07-12  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-07 10:32 [PATCH] mm:vmscan: fix inaccurate reclaim during proactive reclaim Efly Young
2023-07-07 19:09 ` Andrew Morton
2023-07-07 22:55   ` 答复: ?????!?Re: " 杨逸飞
2023-07-11 15:28 ` Johannes Weiner
2023-07-12  7:42   ` Efly Young

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox