[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20110824191621.GL2417@linux.vnet.ibm.com>
Date: Wed, 24 Aug 2011 12:16:21 -0700
From: "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Don Zickus <dzickus@...hat.com>, x86@...nel.org,
Andi Kleen <andi@...stfloor.org>,
Robert Richter <robert.richter@....com>, ying.huang@...el.com,
LKML <linux-kernel@...r.kernel.org>, jason.wessel@...driver.com
Subject: Re: [RFC][PATCH 2/6] x86, nmi: create new NMI handler routines
On Wed, Aug 24, 2011 at 08:19:54PM +0200, Peter Zijlstra wrote:
> On Wed, 2011-08-24 at 14:16 -0400, Don Zickus wrote:
> > On Wed, Aug 24, 2011 at 07:51:00PM +0200, Peter Zijlstra wrote:
> > > On Wed, 2011-08-24 at 13:44 -0400, Don Zickus wrote:
> > > > > > + rcu_read_lock();
> > > > > > + a = rcu_dereference_raw(*ap);
> > > > >
> > > > > The reason for rcu_dereference_raw() is to prevent lockdep from choking
> > > > > due to being called from an NMI handler, correct? If so, please add a
> > > > > comment to this effect on this and similar uses.
> > > >
> > > > That sounds right. But honestly, I just copied what notifier_call_chain
> > > > had. Regardless, I will make sure to document that in my next version.
> > > > Thanks!
> > >
> > > Not quite right, nmi_enter() does lockdep_disable() and makes
> > > lock_is_held() return always true.
> > >
> > > I think this (and the other sites) could do with rcu_dereference_check(,
> > > lockdep_is_held(&desc->lock)); not that it wouldn't be anything but
> > > documentation since the actual test isn't working from NMI context but I
> > > do think its worth it for that alone.
> >
> > So you want me to remove the _raw part of the dereference? I can test
> > that with lockdep enabled to verify things don't go splat.
>
> Ah, right, its never used from the desc->lock context and we always hold
> rcu_read_lock(), so a simple rcu_dereference() should indeed suffice.
Even better! ;-)
Thanx, Paul
--
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