Re: cpu.stat in core or cpu controller (was Re: [RFC PATCH v2] cgroup: Track time in cgroup v2 freezer)

From: Tejun Heo
Date: Thu Jul 24 2025 - 21:08:43 EST


On Wed, Jul 23, 2025 at 09:28:02AM +0800, Chen Ridong wrote:
> > But beware that the possibility of having cpu.stat without enabling the
> > cpu controller on v2 is a user visible behavior and I'm quite sure some
> > userspace relies on it, so you'd need to preserve that.
>
> This is what I worry about. Thank you for your confirmation.

Yeah, this was an intentional decision - sacrificing a bit of code org
cleanliness for everyday usefulness. Enabling CPU controller can have
substantial overhead and having cpu stats available by default doesn't cost
much while improving usefulness.

Thanks.

--
tejun