Commit 51a96c77 authored by Peter Zijlstra's avatar Peter Zijlstra Committed by Ingo Molnar

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: default avatarOleg Nesterov <oleg@redhat.com>
Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 2e01f474
...@@ -249,8 +249,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen) ...@@ -249,8 +249,11 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
* The migration_call() CPU_DYING callback will have removed all * The migration_call() CPU_DYING callback will have removed all
* runnable tasks from the cpu, there's only the idle task left now * runnable tasks from the cpu, there's only the idle task left now
* that the migration thread is done doing the stop_machine thing. * that the migration thread is done doing the stop_machine thing.
*
* Wait for the stop thread to go away.
*/ */
BUG_ON(!idle_cpu(cpu)); while (!idle_cpu(cpu))
cpu_relax();
/* This actually kills the CPU. */ /* This actually kills the CPU. */
__cpu_die(cpu); __cpu_die(cpu);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment