Skip to contentSkip to conversation

sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA

PATCH In review Lukasz Luba 3 participants 4 messages Feb 27, 2020 Scheduler

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sched/fair: Fix kernel build warning in test_idle_cores() for !SMT NUMA

Fix kernel build warning in kernel/sched/fair.c when CONFIG_SCHED_SMT is not set and CONFIG_NUMA_BALANCING is set.

kernel/sched/fair.c:1524:20: warning: ‘test_idle_cores’ declared ‘static’ but never defined [-Wunused-function]

Fixes ff7db0bf24db9 ("sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks")
Cc Ingo Molnar <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Vincent Guittot <[email protected]> (SCHED_NORMAL)
Cc Dietmar Eggemann <[email protected]> (SCHED_NORMAL)
Cc Mel Gorman <[email protected]>

---

It's on top of tip [1] master branch (which has a merge of sched/urgent).

[1] https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git

 kernel/sched/fair.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/sched/fair.c +2 -0
index 4b5d5e5e701e..4441003b1ad1 100644
@@ -1520,8 +1520,10 @@ static inline bool is_core_idle(int cpu)
 	return true;
 }
 
+#ifdef CONFIG_SCHED_SMT
 /* Forward declarations of select_idle_sibling helpers */
 static inline bool test_idle_cores(int cpu, bool def);
+#endif
 
 struct task_numa_env {
 	struct task_struct *p;
Signature · 1 line
2.17.1
#1 lore raw

Hi Lukasz,

Quoted 5 lines · Lukasz Luba

Fix kernel build warning in kernel/sched/fair.c when CONFIG_SCHED_SMT is not set and CONFIG_NUMA_BALANCING is set.

kernel/sched/fair.c:1524:20: warning: ‘test_idle_cores’ declared ‘static’ but never defined [-Wunused-function]

I've sent a similar fix yesterday at:

https://lore.kernel.org/lkml/[email protected]/

#2 lore raw

Hi Valentin,

Quoted 6 lines · Valentin Schneider

Hi Lukasz,

Quoted 3 lines · Lukasz Luba

Fix kernel build warning in kernel/sched/fair.c when CONFIG_SCHED_SMT is not set and CONFIG_NUMA_BALANCING is set.

Quoted 7 lines
Quoted 2 lines

kernel/sched/fair.c:1524:20: warning: ‘test_idle_cores’ declared ‘static’ but never defined [-Wunused-function]

I've sent a similar fix yesterday at:

https://lore.kernel.org/lkml/[email protected]/

I've missed it. You are referring in the commit message to wrong change
(probably HEAD of that branch), while when you try to bisect, it
will point you to
ff7db0bf24db sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks

I think Mel can simply resend the patches with correct build if Ingo is OK.

If Mel would decide to go with extended approach of ifdefs, then maybe it's also good to put in there numa_idle_core(), which actually uses these test_idle_cores() and is_core_idle()

Regards,
Lukasz

#3 lore raw
Quoted 23 lines · Lukasz Luba

Hi Valentin,

Quoted 6 lines · Valentin Schneider

Hi Lukasz,

Quoted 3 lines · Lukasz Luba

Fix kernel build warning in kernel/sched/fair.c when CONFIG_SCHED_SMT is not set and CONFIG_NUMA_BALANCING is set.

Quoted 7 lines
Quoted 2 lines

kernel/sched/fair.c:1524:20: warning: ???test_idle_cores??? declared ???static??? but never defined [-Wunused-function]

I've sent a similar fix yesterday at:

https://lore.kernel.org/lkml/[email protected]/

I've missed it. You are referring in the commit message to wrong change (probably HEAD of that branch), while when you try to bisect, it will point you to
ff7db0bf24db sched/numa: Prefer using an idle CPU as a migration target instead of comparing tasks

Quoted 7 lines

I think Mel can simply resend the patches with correct build if Ingo is OK.

If Mel would decide to go with extended approach of ifdefs, then maybe it's also good to put in there numa_idle_core(), which actually uses these test_idle_cores() and is_core_idle()

I preferred the first fix. I'll send just it on with an editted changelog to identify the exact patch that caused the problem. Ingo will hopefully let me know if he prefers to pick up the fix on top or a resend of the series with the fix folded in.

Signature · 2 lines
Mel Gorman
SUSE Labs