[PATCH V4 2/4] mm: vmscan: add more comments about cache_trim_mode

Zhongkun He posted 4 patches 9 months, 3 weeks ago
[PATCH V4 2/4] mm: vmscan: add more comments about cache_trim_mode
Posted by Zhongkun He 9 months, 3 weeks ago
Add more comments for cache_trim_mode, and the annotations
provided by Johannes Weiner in [1].

[1]:
https://lore.kernel.org/all/20250314141833.GA1316033@cmpxchg.org/

Signed-off-by: Zhongkun He <hezhongkun.hzk@bytedance.com>
---
 mm/vmscan.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/mm/vmscan.c b/mm/vmscan.c
index ebe1407f6741..49eb2a4e490d 100644
--- a/mm/vmscan.c
+++ b/mm/vmscan.c
@@ -2530,7 +2530,8 @@ static void get_scan_count(struct lruvec *lruvec, struct scan_control *sc,
 
 	/*
 	 * If there is enough inactive page cache, we do not reclaim
-	 * anything from the anonymous working right now.
+	 * anything from the anonymous working right now to make sure
+         * a streaming file access pattern doesn't cause swapping.
 	 */
 	if (sc->cache_trim_mode) {
 		scan_balance = SCAN_FILE;
-- 
2.39.5