[tip: sched/urgent] sched/core: Fix compilation error when cgroup not selected
From: tip-bot2 for Qais Yousef
Date: Fri Nov 08 2019 - 16:41:54 EST
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: e3b8b6a0d12cccf772113d6b5c1875192186fbd4
Gitweb: https://git.kernel.org/tip/e3b8b6a0d12cccf772113d6b5c1875192186fbd4
Author: Qais Yousef <qais.yousef@xxxxxxx>
AuthorDate: Tue, 05 Nov 2019 11:22:12
Committer: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
CommitterDate: Fri, 08 Nov 2019 22:34:14 +01:00
sched/core: Fix compilation error when cgroup not selected
When cgroup is disabled the following compilation error was hit
kernel/sched/core.c: In function âuclamp_update_active_tasksâ:
kernel/sched/core.c:1081:23: error: storage size of âitâ isnât known
struct css_task_iter it;
^~
kernel/sched/core.c:1084:2: error: implicit declaration of function âcss_task_iter_startâ; did you mean â__sg_page_iter_startâ? [-Werror=implicit-function-declaration]
css_task_iter_start(css, 0, &it);
^~~~~~~~~~~~~~~~~~~
__sg_page_iter_start
kernel/sched/core.c:1085:14: error: implicit declaration of function âcss_task_iter_nextâ; did you mean â__sg_page_iter_nextâ? [-Werror=implicit-function-declaration]
while ((p = css_task_iter_next(&it))) {
^~~~~~~~~~~~~~~~~~
__sg_page_iter_next
kernel/sched/core.c:1091:2: error: implicit declaration of function âcss_task_iter_endâ; did you mean âget_task_credâ? [-Werror=implicit-function-declaration]
css_task_iter_end(&it);
^~~~~~~~~~~~~~~~~
get_task_cred
kernel/sched/core.c:1081:23: warning: unused variable âitâ [-Wunused-variable]
struct css_task_iter it;
^~
cc1: some warnings being treated as errors
make[2]: *** [kernel/sched/core.o] Error 1
Fix by protetion uclamp_update_active_tasks() with
CONFIG_UCLAMP_TASK_GROUP
Fixes: babbe170e053 ("sched/uclamp: Update CPU's refcount on TG's clamp changes")
Reported-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Signed-off-by: Qais Yousef <qais.yousef@xxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Tested-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
Cc: Patrick Bellasi <patrick.bellasi@xxxxxxxxxx>
Cc: Mel Gorman <mgorman@xxxxxxx>
Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
Cc: Ben Segall <bsegall@xxxxxxxxxx>
Link: https://lkml.kernel.org/r/20191105112212.596-1-qais.yousef@xxxxxxx
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index dd05a37..afd4d80 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1073,6 +1073,7 @@ uclamp_update_active(struct task_struct *p, enum uclamp_id clamp_id)
task_rq_unlock(rq, p, &rf);
}
+#ifdef CONFIG_UCLAMP_TASK_GROUP
static inline void
uclamp_update_active_tasks(struct cgroup_subsys_state *css,
unsigned int clamps)
@@ -1091,7 +1092,6 @@ uclamp_update_active_tasks(struct cgroup_subsys_state *css,
css_task_iter_end(&it);
}
-#ifdef CONFIG_UCLAMP_TASK_GROUP
static void cpu_util_update_eff(struct cgroup_subsys_state *css);
static void uclamp_update_root_tg(void)
{