aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorPeter Zijlstra <a.p.zijlstra@chello.nl>2010-11-19 14:37:53 -0500
committerIngo Molnar <mingo@elte.hu>2010-11-23 04:29:08 -0500
commit51a96c77815e7f139892a6e9c8275a50e9baebdf (patch)
tree64388fce480b43d0588d108da9e4c526421486cf /kernel
parent2e01f4740a874b6085da6ebf541e7ffde9a72bf2 (diff)
cpu: Remove incorrect BUG_ON
Oleg mentioned that there is no actual guarantee the dying cpu's migration thread is actually finished running when we get there, so replace the BUG_ON() with a spinloop waiting for it. Reported-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> LKML-Reference: <new-submission> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/cpu.c b/kernel/cpu.c
index 3945066fc01d..cb7a1efa9c2b 100644
--- a/kernel/cpu.c
+++ b/kernel/cpu.c
@@ -249,8 +249,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
249 * The migration_call() CPU_DYING callback will have removed all 249 * The migration_call() CPU_DYING callback will have removed all
250 * runnable tasks from the cpu, there's only the idle task left now 250 * runnable tasks from the cpu, there's only the idle task left now
251 * that the migration thread is done doing the stop_machine thing. 251 * that the migration thread is done doing the stop_machine thing.
252 *
253 * Wait for the stop thread to go away.
252 */ 254 */
253 BUG_ON(!idle_cpu(cpu)); 255 while (!idle_cpu(cpu))
256 cpu_relax();
254 257
255 /* This actually kills the CPU. */ 258 /* This actually kills the CPU. */
256 __cpu_die(cpu); 259 __cpu_die(cpu);