vserver 1.9.5.x5
[linux-2.6.git] / kernel / stop_machine.c
index 9610403..e31b1cb 100644 (file)
@@ -52,7 +52,12 @@ static int stopmachine(void *cpu)
                        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. */
@@ -90,7 +95,7 @@ static int stop_machine(void)
        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)
@@ -172,7 +177,7 @@ struct task_struct *__stop_machine_run(int (*fn)(void *), void *data,
 
        /* 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)) {