[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b505c15b-8fd2-44f2-8e33-46ae29c2696e@redhat.com>
Date: Mon, 8 Jul 2024 15:01:39 -0400
From: Waiman Long <longman@...hat.com>
To: Tejun Heo <tj@...nel.org>
Cc: Zefan Li <lizefan.x@...edance.com>, Johannes Weiner <hannes@...xchg.org>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH-cgroup 1/2] cgroup: Show # of subsystem CSSes in
/proc/cgroups
On 7/8/24 14:45, Tejun Heo wrote:
> 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?
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?
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?
Cheers,
Longman
Powered by blists - more mailing lists