diff mbox series

[RT,19/23] sched/core: migrate_enable() must access takedown_cpu_task on !HOTPLUG_CPU

Message ID fc234fb7e45164ddd61e0dbf1f8455a8252994c3.1582814004.git.zanussi@kernel.org
State New
Headers show
Series Linux v4.14.170-rt75-rc2 | expand

Commit Message

Tom Zanussi Feb. 27, 2020, 2:33 p.m. UTC
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

v4.14.170-rt75-rc2 stable review patch.
If anyone has any objections, please let me know.

-----------


[ Upstream commit a61d1977f692e46bad99a100f264981ba08cb4bd ]

The variable takedown_cpu_task is never declared/used on !HOTPLUG_CPU
except for migrate_enable(). This leads to a link error.

Don't use takedown_cpu_task in !HOTPLUG_CPU.

Reported-by: Dick Hollenbeck <dick@softplc.com>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Tom Zanussi <zanussi@kernel.org>
---
 kernel/cpu.c        | 2 ++
 kernel/sched/core.c | 2 ++
 2 files changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/kernel/cpu.c b/kernel/cpu.c
index 17b1ed41bc06..861712ebb81d 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -858,7 +858,9 @@  static int take_cpu_down(void *_param)
 	return 0;
 }
 
+#ifdef CONFIG_PREEMPT_RT_BASE
 struct task_struct *takedown_cpu_task;
+#endif
 
 static int takedown_cpu(unsigned int cpu)
 {
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index ceddb1e27caf..e10e3956bb29 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6987,9 +6987,11 @@  void migrate_enable(void)
 
 	p->migrate_disable = 0;
 	rq->nr_pinned--;
+#ifdef CONFIG_HOTPLUG_CPU
 	if (rq->nr_pinned == 0 && unlikely(!cpu_active(cpu)) &&
 	    takedown_cpu_task)
 		wake_up_process(takedown_cpu_task);
+#endif
 
 	if (!p->migrate_disable_scheduled)
 		goto out;