Re: cpu.stat in core or cpu controller (was Re: [RFC PATCH v2] cgroup: Track time in cgroup v2 freezer)
From: Tejun Heo
Date: Sat Jul 19 2025 - 12:27:41 EST
On Sat, Jul 19, 2025 at 10:01:07AM +0800, Chen Ridong wrote:
...
> What I'm considering is moving the implementation of cpu.stat from cgroup_base_files to
> cpu_cgrp_subsys—without changing the user-facing interface (filenames and content remain the same).
> However, the interface would only appear if the CPU subsystem is enabled.
>
> Currently, cpu.stat and cpu.stat.local are visible in every cgroup, even when the CPU subsystem is
> disabled. The only populated fields in such cases are:
>
> - usage_usec
> - user_usec
> - system_usec
> - nice_usec
>
> I’m unsure whether this change would be acceptable?
I don't think so and don't really see what benefits moving the stats would
bring. Why would we move these?
Thanks.
--
tejun