mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Arjan van de Ven <arjan@infradead.org>, Greg KH <gregkh@suse.de>,
	Dave Jones <davej@codemonkey.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: Lockdep message on workqueue_mutex
Date: Tue, 22 Aug 2006 07:36:40 -0700	[thread overview]
Message-ID: <20060822073640.d6704061.akpm@osdl.org> (raw)
In-Reply-To: <20060822135327.GB29577@osiris.boeblingen.de.ibm.com>

On Tue, 22 Aug 2006 15:53:27 +0200
Heiko Carstens <heiko.carstens@de.ibm.com> wrote:

> On Tue, Aug 22, 2006 at 02:36:32PM +0200, Arjan van de Ven wrote:
> > On Tue, 2006-08-22 at 14:10 +0200, Heiko Carstens wrote:
> > > git commit 9b41ea7289a589993d3daabc61f999b4147872c4 causes the lockdep
> > > message below on cpu hotplug (git kernel of today).
> > > 
> > > We have:
> > > 
> > > cpu_down (takes cpu_add_remove_lock)
> > > [CPU_DOWN_PREPARE]
> > > blocking_notifier_call_chain (takes (cpu_chain).rwsem)
> > > workqueue_cpu_callback (takes workqueue_mutex)
> > > blocking_notifier_call_chain (releases (cpu_chain).rwsem)
> > > [CPU_DEAD]
> > > blocking_notifier_call_chain (takes (cpu_chain).rwsem)
> > >                               ^^^^^^^^^^^^^^^^^^^^^^^
> > > -> reverse locking order, since we still hold workqueue_mutex.
> > > 
> > > But since all of this is protected by the cpu_add_remove_lock this looks
> > > legal. Well, at least it's safe as long as no other cpu callback function
> > > does anything that will take the workqueue_mutex as well.
> > 
> > so you're saying this locking is entirely redundant ? ;-)
> 
> No, I'm just saying that I think that it currently cannot deadlock. But I
> think the workqueue cpu hotplug code should be changed, so that it doesn't
> return with the workqueue_mutex being held.

That's deliberate: it's to prevent the workqueue code from walking
cpu_online_map while it is in the process of being changed.

  reply	other threads:[~2006-08-22 14:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-22 12:10 Heiko Carstens
2006-08-22 12:36 ` Arjan van de Ven
2006-08-22 13:53   ` Heiko Carstens
2006-08-22 14:36     ` Andrew Morton [this message]
2006-08-22 14:26   ` Andrew Morton

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=20060822073640.d6704061.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=arjan@infradead.org \
    --cc=davej@codemonkey.org.uk \
    --cc=gregkh@suse.de \
    --cc=heiko.carstens@de.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®