Re: [PATCH] cgroup: add cpu.stat.percpu for per-CPU cgroup stats
From: Tejun Heo
Date: Tue Apr 07 2026 - 14:27:53 EST
On Mon, Apr 06, 2026 at 06:06:43PM -0700, Willy Barro Raffel wrote:
> Expose per-CPU subtree_bstat via a new cgroupfs file cpu.stat.percpu.
> Each line shows one CPU cumulative stats in io.stat-style key=value
> format:
>
> cpu0 usage_usec=123 user_usec=45 system_usec=78 nice_usec=0
> cpu1 usage_usec=456 user_usec=123 system_usec=333 nice_usec=0
>
> This completes the interface left as a TODO in commit 7716f383a583
> ("Merge tag 'cgroup-for-6.6' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup")
> which added per-CPU subtree_bstat but only exposed it via BPF/drgn.
Given how quickly cpu count is increasing with 1k CPUs on common prod
machines not too far off, I'm not sure naively formatting output for every
possible CPU is desirable.
Thanks.
--
tejun