Re: [PATCH] cgroup: add cpu.stat.percpu for per-CPU cgroup stats

From: Michal Koutný

Date: Wed Apr 08 2026 - 08:37:21 EST


On Tue, Apr 07, 2026 at 08:24:33PM +0000, "Barro Raffel, Willy" <willybar@xxxxxxxxxx> wrote:
> On Tue, Apr 07, 2026 at 08:27:41AM -1000, Tejun Heo wrote:
> ...
> >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.

Fair point. OTOH, /proc/schedstat also outputs a line for each CPU (that
is admittedly in a simpler format, also online CPUs instead of possible).

> Good point. I can skip CPUs with zero stats in the output, i.e.: a
> cgroup running on 4 of 1024 CPUs would only produce 4 lines. Would
> that address your concern?

The argument "to complete the interface" explains the actual need for
such a new attribute not convincingly.

Willy, what is the expected use of these per-cgroup per-cpu stats?
(Given there's: global per-cpu stat, per-cgroup total stat, cpusets for
binding and the mentioned bpf/drgn availability for precise
control/debugging.)

Thanks,
Michal

Attachment: signature.asc
Description: PGP signature