Re: USB device cannot be reconnected and khubd "blocked for more than120 seconds"

From: Linus Torvalds
Date: Tue Jan 15 2013 - 19:36:41 EST


On Tue, Jan 15, 2013 at 3:50 PM, Tejun Heo <tj@xxxxxxxxxx> wrote:
>
> For now, I'm gonna implement simple "I'm not gonna wait for myself"
> self-deadlock avoidance.

You can't really do that. Or rather, it won't *help*.

The thing is, the module loading in particular is not necessarily
happening in the same context as what *started* the module loading. A
module loader will request the module from user space, and then later
user space - through possibly a totally unrelated process - will
finish it. So there is no "myself". There's not even necessarily any
relationship that the kernel even knows about, because the module
loading request can have gone from usermode_helper over something like
dbus to systemd.

See?

There's a reason I asked for a warning for this. Or the "let's flag
the current thread if it ever started anything asynchronous". Because
it's complicated.

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