[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090302033638.GA8096@localhost>
Date: Mon, 2 Mar 2009 11:36:38 +0800
From: Wu Fengguang <fengguang.wu@...el.com>
To: Nick Piggin <npiggin@...e.de>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Pekka Enberg <penberg@...helsinki.fi>
Subject: Re: recursive slqb_lock
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@...e.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists