lkml.org 
[lkml]   [2015]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/9] module: Sanitize RCU usage and locking
On Thu, Apr 09, 2015 at 12:21:43PM +0800, Lai Jiangshan wrote:
> On 04/09/2015 12:48 AM, Peter Zijlstra wrote:
>
> > +static void module_assert_mutex_or_preempt(void)
> > +{
> > +#ifdef CONFIG_LOCKDEP
> > + int rcu_held = rcu_read_lock_sched_held();
> > + int mutex_held = 1;
> > +
> > + if (debug_locks)
> > + mutex_held = lockdep_is_held(&module_mutex);
> > +
> > + WARN_ON(!rcu_held && !mutex_held);
> > +#endif
> > +}
>
> Is rcu_lockdep_assert() suitable for it?
> (note rcu_lockdep_assert() only works when CONFIG_PROVE_RCU)

Nah, this works.



\
 
 \ /
  Last update: 2015-04-09 15:21    [W:0.123 / U:11.852 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site