From 59d76bdec9909729e5ad0efc6c68ae46727b612a Mon Sep 17 00:00:00 2001 From: Steven Barrett Date: Wed, 11 Aug 2021 18:41:50 -0500 Subject: [PATCH] ZEN: Tune mgLRU to protect cache used in the last second Although not identical to the le9 patches that protect a byte-amount of cache through tunables, multigenerational LRU now supports protecting cache accessed in the last X milliseconds. In #218, Yu recommends starting with 1000ms and tuning as needed. This looks like a safe default and turning on this feature should help users that don't know they need it. --- mm/vmscan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/vmscan.c b/mm/vmscan.c index 4b81c227fc7a7a..ae0e364c012b77 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4333,7 +4333,11 @@ static int get_swappiness(struct lruvec *lruvec) return swappiness; } +#ifdef CONFIG_ZEN_INTERACTIVE +static DEFINE_RATELIMIT_STATE(lru_gen_min_ttl, 1000, 1); +#else static DEFINE_RATELIMIT_STATE(lru_gen_min_ttl, 0, 1); +#endif static unsigned long get_nr_to_scan(struct lruvec *lruvec, struct scan_control *sc, int swappiness)