Re: Q: down_killable() is racy? or schedule() is not right?

From: Ingo Molnar
Date: Mon Jun 09 2008 - 07:43:46 EST



* Dmitry Adamushko <dmitry.adamushko@xxxxxxxxx> wrote:

> > This looks racy. If SIGKILL comes in the WINDOW above, the event is
> > lost. The task will wait for up() or timeout with the fatal signal
> > pending, and it is not possible to wakeup it via kill() again.
> >
> > This is easy to fix, but I wonder if we should change schedule()
> > instead.
>
> [ for what it's worth ] I think, you are definitely right here.
>
> The schedule() would be the right place to fix it. At the very least,
> because otherwise callers are obliged to always check for
> fatal_signal_pending(task) before scheduling with state ==
> TASK_KILLABLE. e.g. schedule_timeout_killable().
>
> Not very nice, IMHO.

i guess we should fix this in schedule() - is there a patch i could try?

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