mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Chen Ridong <chenridong@huawei.com>
Cc: lizefan.x@bytedance.com, hannes@cmpxchg.org, longman@redhat.com,
	cgroups@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] cgroup: distinguish name and legacy_name when show /proc/cgroups
Date: Mon, 8 Jul 2024 08:42:51 -1000	[thread overview]
Message-ID: <ZowzK7T50fGtgFtW@slm.duckdns.org> (raw)
In-Reply-To: <20240706113830.1612319-1-chenridong@huawei.com>

Hello,

On Sat, Jul 06, 2024 at 11:38:30AM +0000, Chen Ridong wrote:
> Subsys_name may be different between v1 and v2. In cgroup v2
> blk subsys_name is io, while it is named blkio in cgroup v1.
> It better to distinguish name and legacy_name when we cat /proc/cgroups.
> 
> Signed-off-by: Chen Ridong <chenridong@huawei.com>
> ---
>  kernel/cgroup/cgroup-v1.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
> index b9dbf6bf2779..b29252ad91b6 100644
> --- a/kernel/cgroup/cgroup-v1.c
> +++ b/kernel/cgroup/cgroup-v1.c
> @@ -677,7 +677,8 @@ int proc_cgroupstats_show(struct seq_file *m, void *v)
>  
>  	for_each_subsys(ss, i)
>  		seq_printf(m, "%s\t%d\t%d\t%d\n",
> -			   ss->legacy_name, ss->root->hierarchy_id,
> +			   ss->root == &cgrp_dfl_root ? ss->name : ss->legacy_name,
> +			   ss->root->hierarchy_id,

No matter what we do, this is a user visible change and the file isn't all
that useful for cgroup2 anyway. I'd much rather leave it as-is and let it
wither away.

Thanks.

-- 
tejun

      reply	other threads:[~2024-07-08 18:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-06 11:38 Chen Ridong
2024-07-08 18:42 ` Tejun Heo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZowzK7T50fGtgFtW@slm.duckdns.org \
    --to=tj@kernel.org \
    --cc=cgroups@vger.kernel.org \
    --cc=chenridong@huawei.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan.x@bytedance.com \
    --cc=longman@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®