]> www.infradead.org Git - users/jedix/linux-maple.git/commit
writeback: memcg: simplify cgroup_writeback_by_id
authorShakeel Butt <shakeelb@google.com>
Mon, 23 Aug 2021 23:59:08 +0000 (09:59 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 25 Aug 2021 23:33:41 +0000 (09:33 +1000)
commite9eb0348e0f1031b9e3f77d2be8a6ef1c6b3520e
tree00adaa779434acc4bd6187328bd8843885a74225
parent56d657271ff6380d58be0100ef1e40a5e176ff8c
writeback: memcg: simplify cgroup_writeback_by_id

Currently cgroup_writeback_by_id calls mem_cgroup_wb_stats() to get dirty
pages for a memcg.  However mem_cgroup_wb_stats() does a lot more than
just get the number of dirty pages.  Just directly get the number of dirty
pages instead of calling mem_cgroup_wb_stats().  Also
cgroup_writeback_by_id() is only called for best-effort dirty flushing, so
remove the unused 'nr' parameter and no need to explicitly flush memcg
stats.

Link: https://lkml.kernel.org/r/20210722182627.2267368-1-shakeelb@google.com
Signed-off-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
fs/fs-writeback.c
include/linux/memcontrol.h
include/linux/writeback.h
mm/memcontrol.c