git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.5.x5
[linux-2.6.git]
/
kernel
/
stop_machine.c
diff --git
a/kernel/stop_machine.c
b/kernel/stop_machine.c
index
9610403
..
e31b1cb
100644
(file)
--- a/
kernel/stop_machine.c
+++ b/
kernel/stop_machine.c
@@
-52,7
+52,12
@@
static int stopmachine(void *cpu)
mb(); /* Must read state first. */
atomic_inc(&stopmachine_thread_ack);
}
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. */
}
/* Ack: we are exiting. */
@@
-90,7
+95,7
@@
static int stop_machine(void)
stopmachine_state = STOPMACHINE_WAIT;
for_each_online_cpu(i) {
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)
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)
/* 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)) {
p = kthread_create(do_stop, &smdata, "kstopmachine");
if (!IS_ERR(p)) {