From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757896Ab3APAg6 (ORCPT ); Tue, 15 Jan 2013 19:36:58 -0500 Received: from mail-vc0-f179.google.com ([209.85.220.179]:61097 "EHLO mail-vc0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757651Ab3APAgz (ORCPT ); Tue, 15 Jan 2013 19:36:55 -0500 MIME-Version: 1.0 In-Reply-To: <20130115235043.GJ2668@htj.dyndns.org> References: <20130115183204.GE2668@htj.dyndns.org> <20130115235043.GJ2668@htj.dyndns.org> From: Linus Torvalds Date: Tue, 15 Jan 2013 16:36:34 -0800 X-Google-Sender-Auth: zbF4Ho30qlcgCw-WObzAaoDkxUg Message-ID: Subject: Re: USB device cannot be reconnected and khubd "blocked for more than 120 seconds" To: Tejun Heo Cc: Ming Lei , Alex Riesen , Alan Stern , Jens Axboe , USB list , Linux Kernel Mailing List , Arjan van de Ven Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 15, 2013 at 3:50 PM, Tejun Heo 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