Skip to content

Commit d9b3ce8

Browse files
shakeelbakpm00
authored andcommitted
mm: writeback: ratelimit stat flush from mem_cgroup_wb_stats
One of our workloads (Postgres 14) has regressed when migrated from 5.10 to 6.1 upstream kernel. The regression can be reproduced by sysbench's oltp_write_only benchmark. It seems like the always on rstat flush in mem_cgroup_wb_stats() is causing the regression. So, rate limit that specific rstat flush. One potential consequence would be the dirty throttling might be decided on stale memcg stats. However from our benchmarks and production traffic we have not observed any change in the dirty throttling behavior of the application. Link: https://lkml.kernel.org/r/[email protected] Fixes: 2d146aa ("mm: memcontrol: switch to rstat") Signed-off-by: Shakeel Butt <[email protected]> Acked-by: Johannes Weiner <[email protected]> Acked-by: Roman Gushchin <[email protected]> Cc: Jan Kara <[email protected]> Cc: Jens Axboe <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Muchun Song <[email protected]> Cc: Tejun Heo <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 085ff35 commit d9b3ce8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/memcontrol.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4800,7 +4800,7 @@ void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,
48004800
struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css);
48014801
struct mem_cgroup *parent;
48024802

4803-
mem_cgroup_flush_stats(memcg);
4803+
mem_cgroup_flush_stats_ratelimited(memcg);
48044804

48054805
*pdirty = memcg_page_state(memcg, NR_FILE_DIRTY);
48064806
*pwriteback = memcg_page_state(memcg, NR_WRITEBACK);

0 commit comments

Comments
 (0)