cgroup: support to enable nmi-safe css_rstat_updated
authorShakeel Butt <shakeel.butt@linux.dev>
Tue, 17 Jun 2025 19:57:22 +0000 (12:57 -0700)
committerTejun Heo <tj@kernel.org>
Tue, 17 Jun 2025 19:58:45 +0000 (09:58 -1000)
commit1257b8786ac689a2ce5fe3e1741c65038035adc6
tree4765bf5a78d295f2aca3dce1d901ec7280110b71
parent5da4f9db980cc475bb6f027153cce75eaa3026ec
cgroup: support to enable nmi-safe css_rstat_updated

Add necessary infrastructure to enable the nmi-safe execution of
css_rstat_updated(). Currently css_rstat_updated() takes a per-cpu
per-css raw spinlock to add the given css in the per-cpu per-css update
tree. However the kernel can not spin in nmi context, so we need to
remove the spinning on the raw spinlock in css_rstat_updated().

To support lockless css_rstat_updated(), let's add necessary data
structures in the css and ss structures.

Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Tested-by: JP Kobryn <inwardvessel@gmail.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup-defs.h
kernel/cgroup/rstat.c