linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: Greg KH <greg@kroah.com>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: Re: call_usermodehelper hang
Date: Wed, 07 Apr 2004 09:00:14 -0500	[thread overview]
Message-ID: <4074096E.9090202@us.ibm.com> (raw)
In-Reply-To: 20040407061146.GA10413@kroah.com

Greg KH wrote:
> On Tue, Apr 06, 2004 at 05:29:03PM -0700, Andrew Morton wrote:
> 
>>Brian King <brking@us.ibm.com> wrote:
>>
>>>I have been running into some kernel hangs due to call_usermodehelper. Looking
>>>at the backtrace, it looks to me like there are deadlock issues with adding
>>>devices from work queues. Attached is a sample backtrace from one of the
>>>hangs I experienced. My question is why does call_usermodehelper do 2 different
>>>things depending on whether or not it is called from the kevent task? It appears
>>>that the simple way to fix the hang would be to never have call_usermodehelper
>>>use a work_queue since it must be called from process context anyway, or
>>>am I missing something?
>>>
>>
>>swapper is running call_usermodehelper() while holding
>>down_write(&bus->subsys.rwsem); via bus_add_driver().
>>
>>Meanwhile, keventd is blocked on the same lock in bus_add_device().
>>
>>I'd say that the bug lies in the kobject code - we should not call
>>call_usermodehelper() while holding any locks which keventd may ever
>>acquire.
> 
> 
> How is keventd calling sysfs code?  Is scsi using it to drive device
> detection somehow?  I don't see how the kobject core code itself can do
> this on its own.

scsi_add_device is being called from keventd by the ipr LLD. I am assuming this
is a reasonable thing to do. If not, then I would argue the scsi_add_device API
is broken as it must be called from task level, and if a LLD cannot use keventd,
then every LLD that wants to use it would need to create its own workqueue thread.


-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center


  reply	other threads:[~2004-04-07 14:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 18:11 call_usermodehelper hang Brian King
2004-04-07  0:29 ` Andrew Morton
2004-04-07  6:11   ` Greg KH
2004-04-07 14:00     ` Brian King [this message]
2004-04-07 22:58     ` [PATCH] " Brian King
2004-04-08 22:47       ` Greg KH
2004-04-09 20:42         ` Brian King
2004-04-09 20:53           ` Greg KH
2004-04-09 21:05             ` Brian King
2004-04-09 21:15             ` Andrew Morton
2004-04-10 16:53               ` Greg KH
2004-04-10 20:11                 ` Andrew Morton
2004-04-12 15:25                   ` Brian King
2004-04-12 17:46                     ` Andrew Morton
2004-04-16 17:55                       ` Brian King
2004-04-12 18:49                   ` Greg KH
2004-04-08 23:17       ` Chris Wright
2004-04-07  0:41 ` Chris Wright
2004-04-07  1:46   ` Brian King
     [not found] <4072E2F5.9060604@us.ibm.com>
2004-04-16  8:52 ` Heiko Carstens
2004-04-16 14:06   ` Brian King
2005-02-25 17:17 Payasam Manohar
2005-02-25 18:06 ` Lee Revell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4074096E.9090202@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).