mb(); /* Must read state first. */
atomic_inc(&stopmachine_thread_ack);
}
- cpu_relax();
+ /* Yield in first stage: migration threads need to
+ * help our sisters onto their CPUs. */
+ if (!prepared && !irqs_disabled)
+ yield();
+ else
+ cpu_relax();
}
/* Ack: we are exiting. */
stopmachine_state = STOPMACHINE_WAIT;
for_each_online_cpu(i) {
- if (i == smp_processor_id())
+ if (i == _smp_processor_id())
continue;
ret = kernel_thread(stopmachine, (void *)(long)i,CLONE_KERNEL);
if (ret < 0)
/* If they don't care which CPU fn runs on, bind to any online one. */
if (cpu == NR_CPUS)
- cpu = smp_processor_id();
+ cpu = _smp_processor_id();
p = kthread_create(do_stop, &smdata, "kstopmachine");
if (!IS_ERR(p)) {