LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] cgroup: avoid invalid loop in cgroup_no_v1()
@ 2024-04-19  8:53 Xiu Jianfeng
  2024-04-19 15:45 ` Tejun Heo
  0 siblings, 1 reply; 2+ messages in thread
From: Xiu Jianfeng @ 2024-04-19  8:53 UTC (permalink / raw
  To: tj, lizefan.x, hannes; +Cc: cgroups, linux-kernel

We should break the for_each_subsys loop after the token matches
the name of subsys and cgroup_no_v1_mask is set.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
---
 kernel/cgroup/cgroup-v1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 520a11cb12f4..b9dbf6bf2779 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -1335,6 +1335,7 @@ static int __init cgroup_no_v1(char *str)
 				continue;
 
 			cgroup_no_v1_mask |= 1 << i;
+			break;
 		}
 	}
 	return 1;
-- 
2.34.1


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

* Re: [PATCH -next] cgroup: avoid invalid loop in cgroup_no_v1()
  2024-04-19  8:53 [PATCH -next] cgroup: avoid invalid loop in cgroup_no_v1() Xiu Jianfeng
@ 2024-04-19 15:45 ` Tejun Heo
  0 siblings, 0 replies; 2+ messages in thread
From: Tejun Heo @ 2024-04-19 15:45 UTC (permalink / raw
  To: Xiu Jianfeng; +Cc: lizefan.x, hannes, cgroups, linux-kernel

Hello,

Applied to cgroup/for-6.10 w/ title and commit message updates.

Thanks.

----- 8< -----
From 19fc8a896565ecebb3951664fd0eeab0a80314a1 Mon Sep 17 00:00:00 2001
From: Xiu Jianfeng <xiujianfeng@huawei.com>
Date: Fri, 19 Apr 2024 08:53:16 +0000
Subject: [PATCH] cgroup: Avoid unnecessary looping in cgroup_no_v1()

No need to continue the for_each_subsys loop after the token matches the
name of subsys and cgroup_no_v1_mask is set.

Signed-off-by: Xiu Jianfeng <xiujianfeng@huawei.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kernel/cgroup/cgroup-v1.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup-v1.c b/kernel/cgroup/cgroup-v1.c
index 520a11cb12f4..b9dbf6bf2779 100644
--- a/kernel/cgroup/cgroup-v1.c
+++ b/kernel/cgroup/cgroup-v1.c
@@ -1335,6 +1335,7 @@ static int __init cgroup_no_v1(char *str)
 				continue;
 
 			cgroup_no_v1_mask |= 1 << i;
+			break;
 		}
 	}
 	return 1;
-- 
2.44.0


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

end of thread, other threads:[~2024-04-19 15:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-19  8:53 [PATCH -next] cgroup: avoid invalid loop in cgroup_no_v1() Xiu Jianfeng
2024-04-19 15:45 ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).