Re: 2.6.8.1-mm2

From: Ingo Molnar
Date: Fri Aug 20 2004 - 03:42:47 EST



* Rusty Russell <rusty@xxxxxxxxxxxxxxx> wrote:

> Nathan, can you revert that, and apply this? This actually fixes the
> might_sleep problem, and should fix at least the problem Vatsa saw.
> If it doesn't solve your problem, we need to look again.

i've attached a much simpler replacement: dont allow CPU hotplug during
self-reap.

Ingo

DESC

disable preemption in the self-reap codepath, as such tasks may not be
on the tasklist anymore and CPU-hotplug relies on the tasklist to
migrate tasks.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>

--- linux/kernel/exit.c.orig
+++ linux/kernel/exit.c
@@ -25,6 +25,7 @@
#include <linux/proc_fs.h>
#include <linux/mempolicy.h>
#include <linux/perfctr.h>
+#include <linux/cpu.h>

#include <asm/uaccess.h>
#include <asm/unistd.h>
@@ -780,8 +781,14 @@ static void exit_notify(struct task_stru

/* If the process is dead, release it - nobody will wait for it */
if (state == TASK_DEAD) {
+ lock_cpu_hotplug();
release_task(tsk);
write_lock_irq(&tasklist_lock);
+ /*
+ * No preemption may happen from this point on,
+ * or CPU hotplug (and task exit) breaks:
+ */
+ unlock_cpu_hotplug();
tsk->state = state;
_raw_write_unlock(&tasklist_lock);
local_irq_enable();
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/