mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-21 05:14:52 +08:00
mm: ratelimit stat flush from workingset shrinker
commitd4a5b369ad
upstream. 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 commitf82e6bf9bb
("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/20231228073055.4046430-1-shakeelb@google.com Fixes:f82e6bf9bb
("mm: memcg: use rstat for non-hierarchical stats") Signed-off-by: Shakeel Butt <shakeelb@google.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Yosry Ahmed <yosryahmed@google.com> Cc: Yu Zhao <yuzhao@google.com> Cc: Michal Hocko <mhocko@suse.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Cc: Muchun Song <songmuchun@bytedance.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Jesper Dangaard Brouer <hawk@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
15cc248e7e
commit
417dbd7be3
@ -664,7 +664,7 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker,
|
||||
struct lruvec *lruvec;
|
||||
int i;
|
||||
|
||||
mem_cgroup_flush_stats();
|
||||
mem_cgroup_flush_stats_ratelimited();
|
||||
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,
|
||||
|
Loading…
Reference in New Issue
Block a user