From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konstantin Khorenko Date: Fri, 21 Aug 2026 18:42:15 +0200 Subject: [Devel] [PATCH RHEL10 COMMIT] mm/memcg: keep mem_cgroup_per_node::nid available with CONFIG_MEMCG_V1=n In-Reply-To: <20260821163718.187766-14-khorenko@virtuozzo.com> Message-ID: <202608211642.67LGgFeu667329@f0.sw.ru> List-Id: The commit is pushed to "branch-rh10-6.12.0-211.39.1.16.x.vz10-ovz" and will appear at git at bitbucket.org:openvz/vzkernel.git after rh10-6.12.0-211.39.1.16.6.vz10 ------> commit 7e492586e01dfe5cd3a2fcbe420fcc5ec3138340 Author: Konstantin Khorenko Date: Fri Aug 21 18:36:59 2026 +0200 mm/memcg: keep mem_cgroup_per_node::nid available with CONFIG_MEMCG_V1=n mem_cgroup_per_node::nid was added into a kABI hole in the middle of the CONFIG_MEMCG_V1 part of the structure, but it is not a cgroup-v1 field: percpu_stats_memcg() reads it on the lruvec stats path, to find the matching per-node structure of the parent an update is forwarded to once a dying memcg has had its percpu stats freed. So CONFIG_MEMCG=y together with CONFIG_MEMCG_V1=n does not build: mm/memcontrol.c: error: 'struct mem_cgroup_per_node' has no member named 'nid' Declare the field in the CONFIG_MEMCG_V1=n branch as well, next to the other read-mostly members. The v1 branch is left exactly as it is, so the layout of the shipped kernel - and with it the kABI checksum - does not change. Fixes: be640870964f ("mm/memcg: Free percpu stats memory of dying memcg's") Feature: fix rh/mm https://virtuozzo.atlassian.net/browse/VSTOR-134732 Reported-by: Eva Kurchatova Signed-off-by: Konstantin Khorenko --- include/linux/memcontrol.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 72b6b986a08bd..d47c3de71a491 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h @@ -109,6 +109,11 @@ struct mem_cgroup_per_node { bool on_tree; RH_KABI_FILL_HOLE(unsigned short nid) #else + /* + * Not a v1 field: percpu_stats_memcg() needs the node id to find + * the matching per-node structure of the parent memcg. + */ + unsigned short nid; CACHELINE_PADDING(_pad1_); #endif