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).
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();