]> www.infradead.org Git - users/jedix/linux-maple.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>
Fri, 1 Nov 2024 04:29:28 +0000 (21:29 -0700)
commita22a51e5a57077383a13dfbc334878ccfa3cc702
tree690a7cb4babda2b06fc4d8ebaca1ac09762cae89
parentfdfb3a001bdec7904767cced0ec24342920570c8
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