Skip to content

Commit

Permalink
ZEN: Tune mgLRU to protect cache used in the last second
Browse files Browse the repository at this point in the history
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 torvalds#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.
  • Loading branch information
damentz authored and intersectRaven committed Aug 18, 2021
1 parent 9572b4f commit 59d76bd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 59d76bd

Please sign in to comment.