The patch titled Subject: memcg-add-per-memcg-vmalloc-stat-v2 has been added to the -mm tree. Its filename is memcg-add-per-memcg-vmalloc-stat-v2.patch This patch should soon appear at https://ozlabs.org/~akpm/mmots/broken-out/memcg-add-per-memcg-vmalloc-stat-v2.patch and later at https://ozlabs.org/~akpm/mmotm/broken-out/memcg-add-per-memcg-vmalloc-stat-v2.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Shakeel Butt <shakeelb@xxxxxxxxxx> Subject: memcg-add-per-memcg-vmalloc-stat-v2 page_memcg() within rcu lock, per Muchun Link: https://lkml.kernel.org/r/20211222052457.1960701-1-shakeelb@xxxxxxxxxx Signed-off-by: Shakeel Butt <shakeelb@xxxxxxxxxx> Cc: Muchun Song <songmuchun@xxxxxxxxxxxxx> Cc: Johannes Weiner <hannes@xxxxxxxxxxx> Cc: Michal Hocko <mhocko@xxxxxxxxxx> Cc: Roman Gushchin <guro@xxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- include/linux/memcontrol.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) --- a/include/linux/memcontrol.h~memcg-add-per-memcg-vmalloc-stat-v2 +++ a/include/linux/memcontrol.h @@ -996,10 +996,16 @@ static inline void mod_memcg_state(struc static inline void mod_memcg_page_state(struct page *page, int idx, int val) { - struct mem_cgroup *memcg = page_memcg(page); + struct mem_cgroup *memcg; - if (!mem_cgroup_disabled() && memcg) + if (mem_cgroup_disabled()) + return; + + rcu_read_lock(); + memcg = page_memcg(page); + if (memcg) mod_memcg_state(memcg, idx, val); + rcu_read_unlock(); } static inline unsigned long memcg_page_state(struct mem_cgroup *memcg, int idx) _ Patches currently in -mm which might be from shakeelb@xxxxxxxxxx are memcg-better-bounds-on-the-memcg-stats-updates.patch memcg-add-per-memcg-vmalloc-stat.patch memcg-add-per-memcg-vmalloc-stat-v2.patch