[PATCH] scheduler: migration_task deadlock

Erich Focht (efocht@ess.nec.de)
Thu, 28 Feb 2002 18:55:50 +0100 (MET)


Hi,

in the migration scheme included into the 2.5.6-pre1 kernel there is a
potential deadlock (which I encountered several times) in the migration
task. If interrupts are not disabled before aquiring the double rq lock
this task can be interrupted by a scheduler_tick() which will spinwait
forever.

Best regards,
Erich

diff -urN 2.5.6-pre1/kernel/sched.c 2.5.6-pre1-fix/kernel/sched.c
--- 2.5.6-pre1/kernel/sched.c Thu Feb 28 19:10:49 2002
+++ 2.5.6-pre1-fix/kernel/sched.c Thu Feb 28 19:14:29 2002
@@ -1626,9 +1626,11 @@
cpu_src = p->thread_info->cpu;
rq_src = cpu_rq(cpu_src);

+ local_irq_save(flags);
double_rq_lock(rq_src, rq_dest);
if (p->thread_info->cpu != cpu_src) {
double_rq_unlock(rq_src, rq_dest);
+ local_irq_restore(flags);
goto repeat;
}
if (rq_src == rq) {
@@ -1639,6 +1641,7 @@
}
}
double_rq_unlock(rq_src, rq_dest);
+ local_irq_restore(flags);

up(&req->sem);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/