mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Wright <chrisw@osdl.org>
To: Brian King <brking@us.ibm.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: call_usermodehelper hang
Date: Tue, 6 Apr 2004 17:41:50 -0700	[thread overview]
Message-ID: <20040406174150.D22989@build.pdx.osdl.net> (raw)
In-Reply-To: <4072F2B7.2070605@us.ibm.com>; from brking@us.ibm.com on Tue, Apr 06, 2004 at 01:11:03PM -0500

* 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?  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.

swapper							events/0
-------							--------
bus_add_driver()				ipr_worker_thread()
 down_write(&bus->subsys.rwsem) /* here */	 scsi_add_device()
  driver_attach()				  bus_add_device()
   ...						   /* sem is already taken */
   sd_probe()					   down_write(&bus->subsys.rwsem)
    add_disk()					    schedule() /* bye! */
    ...
     call_usermodehelper()
      wait_for_completion() /* never awoken by keventd */

thanks,
-chris
-- 
Linux Security Modules     http://lsm.immunix.org     http://lsm.bkbits.net

  parent reply	other threads:[~2004-04-07  0:41 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-06 18:11 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-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 [this message]
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=20040406174150.D22989@build.pdx.osdl.net \
    --to=chrisw@osdl.org \
    --cc=brking@us.ibm.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

all inboxes | Powered by JetHome®