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

From: Steven Rostedt
Date: Thu May 05 2005 - 08:49:23 EST


On Wed, 2005-05-04 at 23:21 +0200, Alexander Nyberg wrote:

> This patch is very crude but it is quite resistant to recursive faults
> in do_exit(), survives the LTP hammering I've given it. The problem is
> not knowing where in the previous path it broke down so I'd rather just
> leave it lying around and try a graceful reset/power off. But if anyone
> has a better suggestion than the msleep() I'm all ears but this area is
> sensitive.
>
> Where is that anonymous patch hot-line...
>

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

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.

-- Steve


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