lkml.org 
[lkml]   [2011]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC][PATCH 2/6] x86, nmi: create new NMI handler routines
From
Date
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.




\
 
 \ /
  Last update: 2011-08-24 19:53    [from the cache]
©2003-2014 Jasper Spaans. Advertise on this site