public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Wu Fengguang <fengguang.wu@intel.com>
To: Nick Piggin <npiggin@suse.de>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: recursive slqb_lock
Date: Mon, 2 Mar 2009 11:36:38 +0800	[thread overview]
Message-ID: <20090302033638.GA8096@localhost> (raw)
In-Reply-To: <20090301170015.GC26905@wotan.suse.de>

Hi Nick,

On Sun, Mar 01, 2009 at 07:00:15PM +0200, Nick Piggin wrote:
> On Sun, Mar 01, 2009 at 04:07:25PM +0100, Nick Piggin wrote:
> > On Thu, Feb 26, 2009 at 01:34:50PM +0800, Wu Fengguang wrote:
> > > Hi Nick,
> > > 
> > > I got a lockdep warning. It looks like the slqb_lock will be taken
> > > twice in the call chain:
> > > 
> > >         s_start()  => take slqb_lock
> > >           s_show()
> > >             gather_stats()  => take slqb_lock again
> > 
> > Hey, thanks for this. The following patch should fix it.
> > 
> > --
> > Fix the lockdep error reported by Fengguang where down_read slqb_lock
> > is taken twice, with the possibility for a deadlock.
> > 
> > Signed-off-by: Nick Piggin <npiggin@suse.de>

> > +static void gather_stats(struct kmem_cache *s, struct stats_gather *stats)
> > +{
> > +	down_read(&slqb_lock); /* hold off hotplug */
> > +	gather_stats(s, stats);
> > +	up_read(&slqb_lock);
> > +}
> 
> Oops, I didn't test it. That call should be to gather_stats_locked of
> course.

Yeah it fixed the lockdep warning :)

Thanks,
Fengguang

      reply	other threads:[~2009-03-02  3:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-26  5:34 recursive slqb_lock Wu Fengguang
2009-03-01 15:07 ` Nick Piggin
2009-03-01 17:00   ` Nick Piggin
2009-03-02  3:36     ` Wu Fengguang [this message]

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=20090302033638.GA8096@localhost \
    --to=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@suse.de \
    --cc=penberg@cs.helsinki.fi \
    /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