Commit a34eae3b authored by Anton Blanchard's avatar Anton Blanchard Committed by Linus Torvalds

[PATCH] fix busy loop in migration thread init

Since we do not set the task state to TASK_INTERRUPTIBLE, we busy loop.

On larger SMP this can actually result in a lockup due to the way
migration thread initalisation is done (nr_cpus threads are created
and they all busy loop until the scheduler evenly distributes them,
one on each cpu. With this rogue thread busy looping things can become
unbalanced and the migration threads never distribute themselves onto
all cpus).
parent 9523cdad
......@@ -1689,9 +1689,11 @@ void __init migration_init(void)
for (cpu = 0; cpu < smp_num_cpus; cpu++) {
int logical = cpu_logical_map(cpu);
while (!cpu_rq(logical)->migration_thread)
while (!cpu_rq(logical)->migration_thread) {
set_current_state(TASK_INTERRUPTIBLE);
schedule_timeout(2);
}
}
if (migration_mask)
BUG();
......
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