]> www.infradead.org Git - users/hch/misc.git/commit
memcg: factor out mem_cgroup_stat_aggregate()
authorXiu Jianfeng <xiujianfeng@huawei.com>
Sat, 26 Oct 2024 09:34:07 +0000 (09:34 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 7 Nov 2024 22:38:08 +0000 (14:38 -0800)
commit2b1d55498b67ef59bd461236306fa24ae79878e5
tree92daf0e945865faf80bd95f3094cd12adf6e8076
parente8c1a296b8066734ef20797ab77e03a90b0c9be8
memcg: factor out mem_cgroup_stat_aggregate()

Currently mem_cgroup_css_rstat_flush() is used to flush the per-CPU
statistics from a specified CPU into the global statistics of the
memcg. It processes three kinds of data in three for loops using exactly
the same method. Therefore, the for loop can be factored out and may
make the code more clean.

Link: https://lkml.kernel.org/r/20241026093407.310955-1-xiujianfeng@huaweicloud.com
Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Muchun Song <muchun.song@linux.dev>
Cc: Roman Gushchin <roman.gushchin@linux.dev>
Cc: Shakeel Butt <shakeel.butt@linux.dev>
Cc: Wang Weiyang <wangweiyang2@huawei.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/memcontrol.c