On Fri, Jul 18, 2025 at 05:26:54PM +0800, Chen Ridong <chenridong@xxxxxxxxxxxxxxx> wrote: > With the recent merge of the series "cgroup: separate rstat trees," the rstat are not bound to CPU > system. This makes me wonder: should we consider moving the cpu.stat and cpu.stat.local interfaces > to the CPU subsystem? Note that fields printed in cpu.stat are combination of "core" and cpu controller values. > The CPU subsystem could then align more closely with other resource controllers like memory or I/O > subsystems. By decoupling these CPU-specific statistics from the cgroup core, it could help keep > both cgroup and rstat implementations more focused. In my eyes, cpu controller is stuff encapsulated by cpu_cgrp_subsys. I'm not sure I understand what you refer to as the CPU subsystem. One thing is how it is presented to users (filenames and content) another one is how it is implemented. The latter surely can be refactored but it's not obvious to me from the short description, sorry. > Is there any particular reason why the CPU subsystem must remain bound > to the cgroup core? The stuff that's bound to the core is essentially not "control" but only accounting, so with this association, the accounting can have fine granularity while control (which incurs higher overhead in principle) may remain coarse. I find it thus quite fitting that CPU stats build on top of rstat. (Naturally, my previous claim about overhead is only rough and it's the reason for existence of adjustments like in the commit 34f26a15611af ("sched/psi: Per-cgroup PSI accounting disable/re-enable interface").) Thats how I see it, happy to discuss possible problems you see with this. Michal
Attachment:
signature.asc
Description: PGP signature