Messages in this thread | | | From | Linus Torvalds <> | Date | Tue, 15 Jan 2013 16:40:36 -0800 | Subject | Re: USB device cannot be reconnected and khubd "blocked for more than 120 seconds" |
| |
On Tue, Jan 15, 2013 at 4:36 PM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > > 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.
Btw, the sequence counter (that is *not* taking anything else into account) is good enough in practice, exactly because the common case for module loading is actually that nothing in the module init sequence is done asynchronously.
Yes, device discovery (particularly for block devices) is often asynchronous. But the modules it then asks to load usually wouldn't be. So if we just have the flag "did this thread ever even start async work" over the module init sequence, we can just avoid the async serialization entirely for that case, and it breaks the deadlock chain nicely in practice.
Only of a block device does async work and then wants to load another module that does more async work in its init routine would it then break. But at that point, I'll happily just put my foot down and tell people they are crazy, and "Let's not do that kind of crap".
Linus
| |