From: Zhongkun He Date: Mon, 21 Apr 2025 09:13:29 +0000 (+0800) Subject: mm: vmscan: add more comments about cache_trim_mode X-Git-Tag: v6.16-rc1~92^2~120 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aded729f64d3eb1543abc7e6a3a20069716efb7d;p=thirdparty%2Fkernel%2Flinux.git mm: vmscan: add more comments about cache_trim_mode Add more comments for cache_trim_mode, and the annotations provided by Johannes Weiner in [1]. Link: https://lore.kernel.org/all/20250314141833.GA1316033@cmpxchg.org/ Link: https://lkml.kernel.org/r/4baad87ba637f1e6f666e9b99b3fdcb7ab39171b.1745225696.git.hezhongkun.hzk@bytedance.com Signed-off-by: Zhongkun He Cc: Johannes Weiner Cc: Michal Hocko Cc: Muchun Song Cc: Yosry Ahmed Cc: Yu Zhao Signed-off-by: Andrew Morton --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 495889f621b55..ca786575b6c2e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -2536,7 +2536,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;