From: Brian King <brking@us.ibm.com>
To: Chris Wright <chrisw@osdl.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: call_usermodehelper hang
Date: Tue, 06 Apr 2004 20:46:38 -0500 [thread overview]
Message-ID: <40735D7E.2090304@us.ibm.com> (raw)
In-Reply-To: <20040406174150.D22989@build.pdx.osdl.net>
Chris Wright 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?
>
>
> It does two different things because it's trying to run from keventd.
> In the case that current is not keventd, it schedules the work, so
> keventd will pick that work up later to run in it's process context.
>
> How early is this hang?
Pretty early. Boot time, loading scsi drivers. While initializing the
third scsi adapter on the system a device shows up dynamically on the
first adapter, the LLD schedules work to call scsi_add_device and we
end up with the hang.
It looks like init thread adds work and waits
> for it's completion while holding a semaphore. It is never woken up by
> keventd which is sleeping waiting for wakeup from semaphore that init
> thread took.
>
> Seems troubling to hold the sem while calling call_usermodehelper, as that
> could go off for a long time.
I agree. There is another similar hang I ran into recently with the scsi
core in that I was calling scsi_add_device from keventd, which ended up
sleeping on the scan_mutex since the module load process was calling
scsi_scan_host. scsi_scan_host was in the same kobject hotplug code,
calling call_usermodehelper. I figured my LLD shouldn't be doing that,
so I synchronized the events. Perhaps that was the wrong fix... I
suppose I could have changed the LLD to always call
scsi_scan_host/scsi_add_device/etc. from keventd...
-Brian
next prev parent reply other threads:[~2004-04-07 1:46 UTC|newest]
Thread overview: 37+ 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
2004-04-07 22:58 ` [PATCH] " Brian King
2004-04-08 22:47 ` Greg KH
2004-04-08 22:47 ` Greg KH
2004-04-09 20:42 ` Brian King
2004-04-09 20:42 ` Brian King
2004-04-09 20:53 ` Greg KH
2004-04-09 20:53 ` Greg KH
2004-04-09 21:05 ` Brian King
2004-04-09 21:05 ` Brian King
2004-04-09 21:15 ` Andrew Morton
2004-04-09 21:15 ` Andrew Morton
2004-04-10 16:53 ` Greg KH
2004-04-10 16:53 ` Greg KH
2004-04-10 20:11 ` Andrew Morton
2004-04-10 20:11 ` Andrew Morton
2004-04-12 15:25 ` Brian King
2004-04-12 15:25 ` Brian King
2004-04-12 17:46 ` Andrew Morton
2004-04-12 17:46 ` Andrew Morton
2004-04-16 17:55 ` Brian King
2004-04-16 17:55 ` Brian King
2004-04-12 18:49 ` Greg KH
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 [this message]
-- strict thread matches above, loose matches on Subject: below --
2005-02-25 17:17 Payasam Manohar
2005-02-25 18:06 ` Lee Revell
2004-04-06 21:58 Brian King
2004-04-06 17:03 Brian King
2004-04-16 8:52 ` Heiko Carstens
2004-04-16 8:52 ` Heiko Carstens
2004-04-16 14:06 ` Brian King
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=40735D7E.2090304@us.ibm.com \
--to=brking@us.ibm.com \
--cc=chrisw@osdl.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.