Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / kernel / cpu.c
index 4dc279ed3b2d72294255acf9a5f307630ea9a531..9c706af713fbc3c8ee6fa0daf5805b607a92faad 100644 (file)
@@ -525,8 +525,7 @@ static int bringup_wait_for_ap(unsigned int cpu)
        if (WARN_ON_ONCE((!cpu_online(cpu))))
                return -ECANCELED;
 
-       /* Unpark the stopper thread and the hotplug thread of the target cpu */
-       stop_machine_unpark(cpu);
+       /* Unpark the hotplug thread of the target cpu */
        kthread_unpark(st->thread);
 
        /*
@@ -1089,8 +1088,8 @@ void notify_cpu_starting(unsigned int cpu)
 
 /*
  * Called from the idle task. Wake up the controlling task which brings the
- * stopper and the hotplug thread of the upcoming CPU up and then delegates
- * the rest of the online bringup to the hotplug thread.
+ * hotplug thread of the upcoming CPU up and then delegates the rest of the
+ * online bringup to the hotplug thread.
  */
 void cpuhp_online_idle(enum cpuhp_state state)
 {
@@ -1100,6 +1099,12 @@ void cpuhp_online_idle(enum cpuhp_state state)
        if (state != CPUHP_AP_ONLINE_IDLE)
                return;
 
+       /*
+        * Unpart the stopper thread before we start the idle loop (and start
+        * scheduling); this ensures the stopper task is always available.
+        */
+       stop_machine_unpark(smp_processor_id());
+
        st->state = CPUHP_AP_ONLINE_IDLE;
        complete_ap_thread(st, true);
 }