Skip to content

Commit 190409c

Browse files
yosrym93akpm00
authored andcommitted
memcg: flush stats non-atomically in mem_cgroup_wb_stats()
The previous patch moved the wb_over_bg_thresh()->mem_cgroup_wb_stats() code path in wb_writeback() outside the lock section. We no longer need to flush the stats atomically. Flush the stats non-atomically. Link: https://lkml.kernel.org/r/20230421174020.2994750-3-yosryahmed@google.com Signed-off-by: Yosry Ahmed <yosryahmed@google.com> Reviewed-by: Michal Koutný <mkoutny@suse.com> Acked-by: Shakeel Butt <shakeelb@google.com> Acked-by: Tejun Heo <tj@kernel.org> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Christian Brauner <brauner@kernel.org> Cc: Jan Kara <jack@suse.cz> Cc: Jens Axboe <axboe@kernel.dk> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@kernel.org> Cc: Muchun Song <songmuchun@bytedance.com> Cc: Roman Gushchin <roman.gushchin@linux.dev> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
1 parent 2816ea2 commit 190409c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

mm/memcontrol.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4656,11 +4656,7 @@ void mem_cgroup_wb_stats(struct bdi_writeback *wb, unsigned long *pfilepages,
46564656
struct mem_cgroup *memcg = mem_cgroup_from_css(wb->memcg_css);
46574657
struct mem_cgroup *parent;
46584658

4659-
/*
4660-
* wb_writeback() takes a spinlock and calls
4661-
* wb_over_bg_thresh()->mem_cgroup_wb_stats(). Do not sleep.
4662-
*/
4663-
mem_cgroup_flush_stats_atomic();
4659+
mem_cgroup_flush_stats();
46644660

46654661
*pdirty = memcg_page_state(memcg, NR_FILE_DIRTY);
46664662
*pwriteback = memcg_page_state(memcg, NR_WRITEBACK);

0 commit comments

Comments
 (0)