Re: [PATCH 1/2] cgroup: Fix /proc/cgroups count for v2

From: Tejun Heo
Date: Tue May 28 2024 - 15:45:52 EST


Hello,

On Tue, May 28, 2024 at 04:37:12PM +0000, T.J. Mercier wrote:
> The number of cgroups using a controller is an important metric since
> kernel memory is used for each cgroup, and some kernel operations scale
> with the number of cgroups for some controllers (memory, io). So users
> have an interest in minimizing/tracking the number of them.

I agree that this can be a useful metric but am not sure /proc/cgroups is
the right place to put it. Its use of v1 controller names, listing of
controllers that don't exist in v2 and the unnecessary column are rather
ugly and unnecessary. Also, it isn't hierarchical which can make
understanding where the css's are staying allocated difficult.

In v2, cgroup.controllers and cgroup.subtree_control govern which
controllers are available and enabled in the subtree. I think it would make
sense to introduce something in a similar fashion. Can't think of a good
name off the top of my head but add a cgroup. file which lists the
controllers in the subtree along with the number of css's.

Thanks.

--
tejun