BPF programs can run in nmi context and may trigger memcg charged memory allocation in such context. Recently linux added support to nmi safe page allocation along with memcg charging of such allocations. However the kmalloc/slab support and corresponding memcg charging is still lacking, To provide nmi safe support for memcg charging for kmalloc/slab allocations, we need nmi safe memcg stats and for that we need nmi safe css_rstat_updated() which adds the given cgroup state whose stats are updated into the per-cpu per-ss update tree. This series took the aim to make css_rstat_updated() nmi safe. This series is based on [1]. [1] http://lore.kernel.org/20250404011050.121777-1-inwardvessel@xxxxxxxxx Shakeel Butt (3): llist: add list_add_iff_not_on_list() cgroup: support to enable nmi-safe css_rstat_updated cgroup: make css_rstat_updated nmi safe include/linux/cgroup-defs.h | 4 ++ include/linux/llist.h | 3 + kernel/cgroup/rstat.c | 112 ++++++++++++++++++++++++++++-------- lib/llist.c | 30 ++++++++++ 4 files changed, 124 insertions(+), 25 deletions(-) -- 2.47.1