Re: [PATCH-cgroup 1/2] cgroup: Show # of subsystem CSSes in /proc/cgroups

From: Tejun Heo
Date: Mon Jul 08 2024 - 14:45:30 EST


Hello, Waiman.

On Fri, Jul 05, 2024 at 08:56:21PM -0400, Waiman Long wrote:
> The /proc/cgroups file shows the number of cgroups for each of the
> subsystems. With cgroup v1, the number of CSSes is the same as the
> number of cgroups. That is not the case anymore with cgroup v2. The
> /proc/cgroups file cannot show the actual number of CSSes for the
> subsystems that are bound to cgroup v2.
>
> So if a v2 cgroup subsystem is leaking cgroups (typically memory
> cgroup), we can't tell by looking at /proc/cgroups which cgroup
> subsystems may be responsible. This patch adds a css counter in the
> cgroup_subsys structure to keep track of the number of CSSes for each
> of the cgroup subsystems.

The count sounds useful to me but can we add it in cgroup.stats instead?

Thanks.

--
tejun