Re: A patch for the file kernel/fork.c

From: Alexander Nyberg
Date: Thu May 05 2005 - 10:34:14 EST


> Instead of the for(;;) msleep, why not just take it permanently off the
> run queue? With the following:
>
> set_current_state(TASK_UNINTERRUPTIBLE);
> schedule();
>
> It basically gives the same effect, but is cleaner.

Ah perfect, now it looks ok. Thanks!

Prevent recursive faults in do_exit() by leaving the task alone and wait
for reboot. This may allow a more graceful shutdown and possibly save
the original oops.


Signed-off-by: Alexander Nyberg <alexn@xxxxxxxxx>

Index: mm/kernel/exit.c
===================================================================
--- mm.orig/kernel/exit.c 2005-05-05 16:44:20.000000000 +0200
+++ mm/kernel/exit.c 2005-05-05 17:29:40.000000000 +0200
@@ -797,6 +797,14 @@
ptrace_notify((PTRACE_EVENT_EXIT << 8) | SIGTRAP);
}

+ /* We're taking recursive faults here in do_exit. Safest
+ * is to just leave this task alone and wait for reboot. */
+ if (unlikely(tsk->flags & PF_EXITING)) {
+ printk(KERN_ALERT "\nFixing recursive fault but reboot is needed!\n");
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ schedule();
+ }
+
tsk->flags |= PF_EXITING;

/*


-
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/