Re: [PATCH 08/11] module: Fix nested sleep

From: Oleg Nesterov
Date: Mon Sep 29 2014 - 18:21:59 EST


On 09/24, Peter Zijlstra wrote:
>
> A genuine bug, we cannot use blocking primitives inside a wait loop.
>
> So rewrite the wait_event_interruptible() usage to use the fresh
> wait_woken() stuff.

OK, but ...

> +static int wait_finished_loading(struct module *mod)
> +{
> + DEFINE_WAIT_FUNC(wait, woken_wake_function);
> + int ret = 0;
> +
> + add_wait_queue(&module_wq, &wait);
> + for (;;) {
> + if (finished_loading(mod->name))
> + break;
> +
> + if (signal_pending_state(TASK_INTERRUPTIBLE, current)) {

I am puzzled by this line, why not

if (signal_pending(current)) {

?

this should be 100% equivalent.

Oleg.

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