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. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx> --- kernel/cpu.c | 2 ++ kernel/sched/core.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/kernel/cpu.c b/kernel/cpu.c index 123ad9626cc7f..81a6e5068972c 100644 --- a/kernel/cpu.c +++ b/kernel/cpu.c @@ -887,7 +887,9 @@ static int take_cpu_down(void *_param) return 0; } +#ifdef CONFIG_PREEMPT_RT 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 bd26257eb2358..8bea013b2baf5 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -8212,9 +8212,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; -- 2.24.0