[PATCH cgroup/for-6.6-fixes] cgroup: Put cgroup_local_stat_show() inside CONFIG_CGROUP_SCHED

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>From d8416c5d2a38e36651f022be01bb234a404b8f01 Mon Sep 17 00:00:00 2001
From: Tejun Heo <tj@xxxxxxxxxx>
Date: Sat, 2 Sep 2023 05:28:06 -1000

677ea015f231 ("sched: add throttled time stat for throttled children") which
was merged through the sched branch added cgroup_local_stat_show() which is
marked with __maybe_unused and used iff CONFIG_CGROUP_SCHED is set. This was
following the existing pattern of cgroup_extra_stat_show().

However, in the cgroup tree, 1299eb2b0ad5 ("cgroup: minor cleanup for
cgroup_extra_stat_show()") moved cgroup_extra_stat_show() inside
CONFIG_CGROUP_SCHED and dropped __maybe_unused and subsequently d1d4ff5d11a5
("cgroup: put cgroup_tryget_css() inside CONFIG_CGROUP_SCHED") moved
cgroup_tryget_css() inside the config option too as cgroup_extra_stat_show()
was the only user.

When the tree commits met in mainline, this led to a build breakage when
!CONFIG_CGROUP_SCHED as cgroup_tryget_css() was no longer available for the
__maybe_unused cgroup_local_stat_show().

Fix it by moving cgroup_local_stat_show() inside CONFIG_CGROUP_SCHED and
also drop __maybe_unused.

Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
Reported-by: "Sudip Mukherjee (Codethink)" <sudipm.mukherjee@xxxxxxxxx>
Link: http://lkml.kernel.org/r/ZPMdTJ7zwrCkdMTu@debian
Fixes: 677ea015f231 ("sched: add throttled time stat for throttled children")
Cc: Josh Don <joshdon@xxxxxxxxxx>
Cc: Miaohe Lin <linmiaohe@xxxxxxxxxx>
---
Sorry about that. This should fix it. Guess nobody is building linux-next w/
!CONFIG_CGROUP_SCHED. I'll send the pull request to Linus soon.

Thanks.

 kernel/cgroup/cgroup.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index babb34a643ea..156eb96d7cc5 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -3686,8 +3686,9 @@ static int cpu_stat_show(struct seq_file *seq, void *v)
 	return ret;
 }
 
-static int __maybe_unused cgroup_local_stat_show(struct seq_file *seq,
-						 struct cgroup *cgrp, int ssid)
+#ifdef CONFIG_CGROUP_SCHED
+static int cgroup_local_stat_show(struct seq_file *seq, struct cgroup *cgrp,
+				  int ssid)
 {
 	struct cgroup_subsys *ss = cgroup_subsys[ssid];
 	struct cgroup_subsys_state *css;
@@ -3704,6 +3705,7 @@ static int __maybe_unused cgroup_local_stat_show(struct seq_file *seq,
 	css_put(css);
 	return ret;
 }
+#endif
 
 static int cpu_local_stat_show(struct seq_file *seq, void *v)
 {
-- 
2.42.0




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux