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

From: Waiman Long
Date: Mon Jul 08 2024 - 15:18:22 EST



On 7/8/24 15:05, Tejun Heo wrote:
Hello,

On Mon, Jul 08, 2024 at 03:01:39PM -0400, Waiman Long wrote:
That information is certainly useful to display to cgroup.stat which
currently only shows nr_descendants and nr_dying_descendants. So does
"nr_<subsys_name> <cnt>" for each cgroup subsystems look good to you or do
you have other suggestion?
Yeah, something like that. Johannes, what do you think?
OK, will work on that.

The reason for this patch is because I got a bug report about leaking blkio
cgroup due to the information shown in /proc/cgroups. I know you want do
deprecate it for cgroup v2. How about adding a iine like "# Deprecated for
cgroup v2, use cgroup.stats file for cgroup counts" at the top of
/proc/cgroups when cgroup v2 is active?
I wonder whether that would break some parsers but we can try that and see
what happens.

I suppose the parser should skip line that begin with #. When testing this patch, I realize that systemd does parse /proc/cgroups when in cgroup v1 mode and change to it may break the bootup process. This file doesn't seem to be parsed at all when in cgroup v2 mode.

Cheers,
Longman