diff options
author | Shakeel Butt <[email protected]> | 2023-12-28 07:30:55 +0000 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2024-01-05 10:17:45 -0800 |
commit | d4a5b369ad6d8aae552752ff438dddde653a72ec (patch) | |
tree | 0e472f8a9df768201472dc5188244a119c2ea567 | |
parent | 63b85ac56a6498476fb34402c10a3f431f62f35c (diff) |
mm: ratelimit stat flush from workingset shrinker
One of our workloads (Postgres 14 + sysbench OLTP) regressed on newer
upstream kernel and on further investigation, it seems like the cause is
the always synchronous rstat flush in the count_shadow_nodes() added by
the commit f82e6bf9bb9b ("mm: memcg: use rstat for non-hierarchical
stats"). On further inspection it seems like we don't really need
accurate stats in this function as it was already approximating the amount
of appropriate shadow entries to keep for maintaining the refault
information. Since there is already 2 sec periodic rstat flush, we don't
need exact stats here. Let's ratelimit the rstat flush in this code path.
Link: https://lkml.kernel.org/r/[email protected]
Fixes: f82e6bf9bb9b ("mm: memcg: use rstat for non-hierarchical stats")
Signed-off-by: Shakeel Butt <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: Yosry Ahmed <[email protected]>
Cc: Yu Zhao <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Roman Gushchin <[email protected]>
Cc: Muchun Song <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
-rw-r--r-- | mm/workingset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/workingset.c b/mm/workingset.c index 2a2a34234df9..226012974328 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -680,7 +680,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker, struct lruvec *lruvec; int i; - mem_cgroup_flush_stats(sc->memcg); + mem_cgroup_flush_stats_ratelimited(sc->memcg); lruvec = mem_cgroup_lruvec(sc->memcg, NODE_DATA(sc->nid)); for (pages = 0, i = 0; i < NR_LRU_LISTS; i++) pages += lruvec_page_state_local(lruvec, |