All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only
@ 2023-09-20 10:25 ` Kamalesh Babulal
  0 siblings, 0 replies; 5+ messages in thread
From: Kamalesh Babulal @ 2023-09-20 10:25 UTC (permalink / raw)
  To: Tejun Heo, Zefan Li, Johannes Weiner; +Cc: Tom Hromatka, cgroups, linux-kernel

cgroup v1 or v2 or both controller names can be passed as arguments to
the 'cgroup_no_v1' kernel parameter, though most of the controller's
names are the same for both cgroup versions. This can be confusing when
both versions are used interchangeably, i.e., passing cgroup_no_v1=io

$ sudo dmesg |grep cgroup
...
cgroup: Disabling io control group subsystem in v1 mounts
cgroup: Disabled controller 'blkio'

Restrict the check to ss->legacy_name only, when parsing the controller
names passed to cgroup_no_v1 parameter and also, use ss->legacy_name in
pr_info(), that prints the controller disabling information.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
---
 kernel/cgroup/cgroup-v1.c | 3 +--
 kernel/cgroup/cgroup.c    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index c487ffef6652..942872b83bf2 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -1297,8 +1297,7 @@ static int __init cgroup_no_v1(char *str)
 		}
 
 		for_each_subsys(ss, i) {
-			if (strcmp(token, ss->name) &&
-			    strcmp(token, ss->legacy_name))
+			if (strcmp(token, ss->legacy_name))
 				continue;
 
 			cgroup_no_v1_mask |= 1 << i;
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 1fb7f562289d..622fb53a806b 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6121,7 +6121,7 @@ int __init cgroup_init(void)
 
 		if (cgroup1_ssid_disabled(ssid))
 			pr_info("Disabling %s control group subsystem in v1 mounts\n",
-				ss->name);
+				ss->legacy_name);
 
 		cgrp_dfl_root.subsys_mask |= 1 << ss->id;
 

base-commit: 2cf0f715623872823a72e451243bbf555d10d032
-- 
2.41.0


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

* [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only
@ 2023-09-20 10:25 ` Kamalesh Babulal
  0 siblings, 0 replies; 5+ messages in thread
From: Kamalesh Babulal @ 2023-09-20 10:25 UTC (permalink / raw)
  To: Tejun Heo, Zefan Li, Johannes Weiner
  Cc: Tom Hromatka, cgroups-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

cgroup v1 or v2 or both controller names can be passed as arguments to
the 'cgroup_no_v1' kernel parameter, though most of the controller's
names are the same for both cgroup versions. This can be confusing when
both versions are used interchangeably, i.e., passing cgroup_no_v1=io

$ sudo dmesg |grep cgroup
...
cgroup: Disabling io control group subsystem in v1 mounts
cgroup: Disabled controller 'blkio'

Restrict the check to ss->legacy_name only, when parsing the controller
names passed to cgroup_no_v1 parameter and also, use ss->legacy_name in
pr_info(), that prints the controller disabling information.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
---
 kernel/cgroup/cgroup-v1.c | 3 +--
 kernel/cgroup/cgroup.c    | 2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index c487ffef6652..942872b83bf2 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -1297,8 +1297,7 @@ static int __init cgroup_no_v1(char *str)
 		}
 
 		for_each_subsys(ss, i) {
-			if (strcmp(token, ss->name) &&
-			    strcmp(token, ss->legacy_name))
+			if (strcmp(token, ss->legacy_name))
 				continue;
 
 			cgroup_no_v1_mask |= 1 << i;
diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 1fb7f562289d..622fb53a806b 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -6121,7 +6121,7 @@ int __init cgroup_init(void)
 
 		if (cgroup1_ssid_disabled(ssid))
 			pr_info("Disabling %s control group subsystem in v1 mounts\n",
-				ss->name);
+				ss->legacy_name);
 
 		cgrp_dfl_root.subsys_mask |= 1 << ss->id;
 

base-commit: 2cf0f715623872823a72e451243bbf555d10d032
-- 
2.41.0


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

* Re: [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only
  2023-09-20 10:25 ` Kamalesh Babulal
  (?)
@ 2023-10-04 19:17 ` Tejun Heo
  2023-10-05 11:21   ` [External] : " Kamalesh Babulal
  -1 siblings, 1 reply; 5+ messages in thread
From: Tejun Heo @ 2023-10-04 19:17 UTC (permalink / raw)
  To: Kamalesh Babulal
  Cc: Zefan Li, Johannes Weiner, Tom Hromatka, cgroups, linux-kernel

On Wed, Sep 20, 2023 at 03:55:12PM +0530, Kamalesh Babulal wrote:
> cgroup v1 or v2 or both controller names can be passed as arguments to
> the 'cgroup_no_v1' kernel parameter, though most of the controller's
> names are the same for both cgroup versions. This can be confusing when
> both versions are used interchangeably, i.e., passing cgroup_no_v1=io
> 
> $ sudo dmesg |grep cgroup
> ...
> cgroup: Disabling io control group subsystem in v1 mounts
> cgroup: Disabled controller 'blkio'

So, making the printed names consistent makes sense but I'm not sure about
not matching "io" anymore. That's gonna break users who already use them,
right?

Thanks.

-- 
tejun

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

* Re: [External] : Re: [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only
  2023-10-04 19:17 ` Tejun Heo
@ 2023-10-05 11:21   ` Kamalesh Babulal
  2023-10-05 18:12     ` Tejun Heo
  0 siblings, 1 reply; 5+ messages in thread
From: Kamalesh Babulal @ 2023-10-05 11:21 UTC (permalink / raw)
  To: Tejun Heo; +Cc: Zefan Li, Johannes Weiner, Tom Hromatka, cgroups, linux-kernel



On 10/5/23 00:47, Tejun Heo wrote:
> On Wed, Sep 20, 2023 at 03:55:12PM +0530, Kamalesh Babulal wrote:
>> cgroup v1 or v2 or both controller names can be passed as arguments to
>> the 'cgroup_no_v1' kernel parameter, though most of the controller's
>> names are the same for both cgroup versions. This can be confusing when
>> both versions are used interchangeably, i.e., passing cgroup_no_v1=io
>>
>> $ sudo dmesg |grep cgroup
>> ...
>> cgroup: Disabling io control group subsystem in v1 mounts
>> cgroup: Disabled controller 'blkio'
> 
> So, making the printed names consistent makes sense but I'm not sure about
> not matching "io" anymore. That's gonna break users who already use them,
> right?

Agreed, users might pass "io" in place of "blkio", I was thinking
in terms of cgroup v1 users, for whom it is "blkio" controller but
as an argument, "cgroup_no_v1" makes the controllers passed to it,
available under cgroup v2, where the controller is named "io",
which the user may use interchangeably.

Shall I re-send the patch to print the controller legacy_name only?

-- 
Thanks,
Kamalesh

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

* Re: [External] : Re: [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only
  2023-10-05 11:21   ` [External] : " Kamalesh Babulal
@ 2023-10-05 18:12     ` Tejun Heo
  0 siblings, 0 replies; 5+ messages in thread
From: Tejun Heo @ 2023-10-05 18:12 UTC (permalink / raw)
  To: Kamalesh Babulal
  Cc: Zefan Li, Johannes Weiner, Tom Hromatka, cgroups, linux-kernel

On Thu, Oct 05, 2023 at 04:51:52PM +0530, Kamalesh Babulal wrote:
> 
> 
> On 10/5/23 00:47, Tejun Heo wrote:
> > On Wed, Sep 20, 2023 at 03:55:12PM +0530, Kamalesh Babulal wrote:
> >> cgroup v1 or v2 or both controller names can be passed as arguments to
> >> the 'cgroup_no_v1' kernel parameter, though most of the controller's
> >> names are the same for both cgroup versions. This can be confusing when
> >> both versions are used interchangeably, i.e., passing cgroup_no_v1=io
> >>
> >> $ sudo dmesg |grep cgroup
> >> ...
> >> cgroup: Disabling io control group subsystem in v1 mounts
> >> cgroup: Disabled controller 'blkio'
> > 
> > So, making the printed names consistent makes sense but I'm not sure about
> > not matching "io" anymore. That's gonna break users who already use them,
> > right?
> 
> Agreed, users might pass "io" in place of "blkio", I was thinking
> in terms of cgroup v1 users, for whom it is "blkio" controller but
> as an argument, "cgroup_no_v1" makes the controllers passed to it,
> available under cgroup v2, where the controller is named "io",
> which the user may use interchangeably.
> 
> Shall I re-send the patch to print the controller legacy_name only?

Yes, let's do that.

Thanks.

-- 
tejun

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

end of thread, other threads:[~2023-10-05 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-20 10:25 [PATCH] cgroup: In cgroup_no_v1() check v1 controllers only Kamalesh Babulal
2023-09-20 10:25 ` Kamalesh Babulal
2023-10-04 19:17 ` Tejun Heo
2023-10-05 11:21   ` [External] : " Kamalesh Babulal
2023-10-05 18:12     ` Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.