Skip to content

Commit

Permalink
ZEN: INTERACTIVE: 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 heftig committed Sep 15, 2024
1 parent e2db8ce commit f5b82cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ config ZEN_INTERACTIVE
--- Virtual Memory Subsystem ---------------------------

Background-reclaim hugepages...: no -> yes
MG-LRU minimum cache TTL.......: 0 -> 1000 ms

config BROKEN
bool
Expand Down
4 changes: 4 additions & 0 deletions mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -3968,7 +3968,11 @@ static bool lruvec_is_reclaimable(struct lruvec *lruvec, struct scan_control *sc
}

/* to protect the working set of the last N jiffies */
#ifdef CONFIG_ZEN_INTERACTIVE
static unsigned long lru_gen_min_ttl __read_mostly = HZ;
#else
static unsigned long lru_gen_min_ttl __read_mostly;
#endif

static void lru_gen_age_node(struct pglist_data *pgdat, struct scan_control *sc)
{
Expand Down

0 comments on commit f5b82cc

Please sign in to comment.