path: root/kernel/smpboot.c
diff options
authorOleg Nesterov <>2015-10-09 18:00:49 +0200
committerIngo Molnar <>2015-10-20 10:23:55 +0200
commitc00166d87e730088d919814020e96ffed129d0d1 (patch)
tree89194ca8d10e2c6ceddf203958e65787927d9f9b /kernel/smpboot.c
parentd8bc853582bfd81a9c08ca6922aeb01570080ccc (diff)
stop_machine: Kill smp_hotplug_thread->pre_unpark, introduce stop_machine_unpark()
1. Change smpboot_unpark_thread() to check ->selfparking, just like smpboot_park_thread() does. 2. Introduce stop_machine_unpark() which sets ->enabled and calls kthread_unpark(). 3. Change smpboot_thread_call() and cpu_stop_init() to call stop_machine_unpark() by hand. This way: - IMO the ->selfparking logic becomes more consistent. - We can kill the smp_hotplug_thread->pre_unpark() method. - We can easily unpark the stopper thread earlier. Say, we can move stop_machine_unpark() from smpboot_thread_call() to sched_cpu_active() as Peter suggests. Signed-off-by: Oleg Nesterov <> Signed-off-by: Peter Zijlstra (Intel) <> Cc: Andrew Morton <> Cc: Linus Torvalds <> Cc: Mike Galbraith <> Cc: Paul E. McKenney <> Cc: Peter Zijlstra <> Cc: Rik van Riel <> Cc: Tejun Heo <> Cc: Thomas Gleixner <> Cc: Link: Signed-off-by: Ingo Molnar <>
Diffstat (limited to 'kernel/smpboot.c')
1 files changed, 2 insertions, 3 deletions
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index a818cbc73e14..d264f59bff56 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -222,9 +222,8 @@ static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cp
struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu);
- if (ht->pre_unpark)
- ht->pre_unpark(cpu);
- kthread_unpark(tsk);
+ if (!ht->selfparking)
+ kthread_unpark(tsk);
void smpboot_unpark_threads(unsigned int cpu)