mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] cgroup: distinguish name and legacy_name when show /proc/cgroups
@ 2024-07-06 11:38 Chen Ridong
  2024-07-08 18:42 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Ridong @ 2024-07-06 11:38 UTC (permalink / raw)
  To: tj, lizefan.x, hannes, longman; +Cc: cgroups, linux-kernel

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,
 			   atomic_read(&ss->root->nr_cgrps),
 			   cgroup_ssid_enabled(i));
 
-- 
2.34.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-07-08 18:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-06 11:38 [PATCH -next] cgroup: distinguish name and legacy_name when show /proc/cgroups Chen Ridong
2024-07-08 18:42 ` Tejun Heo

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®