Skip to content

Commit 3180d89

Browse files
Paul E. McKenneyKAGA-KOKO
authored andcommitted
hotplug: Fix UP bug in smpboot hotplug code
Because kernel subsystems need their per-CPU kthreads on UP systems as well as on SMP systems, the smpboot hotplug kthread functions must be provided in UP builds as well as in SMP builds. This commit therefore adds smpboot.c to UP builds and excludes irrelevant code via #ifdef. Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent f97f8f0 commit 3180d89

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎kernel/Makefile‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ obj-y = fork.o exec_domain.o panic.o printk.o \
1010
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
1111
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
1212
notifier.o ksysfs.o cred.o \
13-
async.o range.o groups.o lglock.o
13+
async.o range.o groups.o lglock.o smpboot.o
1414

1515
ifdef CONFIG_FUNCTION_TRACER
1616
# Do not trace debug files and internal ftrace files
@@ -46,7 +46,6 @@ obj-$(CONFIG_DEBUG_RT_MUTEXES) += rtmutex-debug.o
4646
obj-$(CONFIG_RT_MUTEX_TESTER) += rtmutex-tester.o
4747
obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o
4848
obj-$(CONFIG_SMP) += smp.o
49-
obj-$(CONFIG_SMP) += smpboot.o
5049
ifneq ($(CONFIG_SMP),y)
5150
obj-y += up.o
5251
endif

‎kernel/smpboot.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515

1616
#include "smpboot.h"
1717

18+
#ifdef CONFIG_SMP
19+
1820
#ifdef CONFIG_GENERIC_SMP_IDLE_THREAD
1921
/*
2022
* For the hotplug case we keep the task structs around and reuse
@@ -72,6 +74,8 @@ void __init idle_threads_init(void)
7274
}
7375
#endif
7476

77+
#endif /* #ifdef CONFIG_SMP */
78+
7579
static LIST_HEAD(hotplug_threads);
7680
static DEFINE_MUTEX(smpboot_threads_lock);
7781

0 commit comments

Comments
 (0)