Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1187213

Re: linux-next: build failure after merge of the rcu tree

From "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: linux-next: build failure after merge of the rcu tree
Date 2015-07-17 23:40 +0200
Message-ID <pNlwm-JB-13@gated-at.bofh.it> (permalink)
References (1 earlier) <pMIv0-3mF-3@gated-at.bofh.it> <pNcjo-4ml-9@gated-at.bofh.it> <pNhM7-3Ot-33@gated-at.bofh.it> <pNj1x-5wQ-35@gated-at.bofh.it> <pNjXA-6S1-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, Jul 17, 2015 at 09:51:31PM +0200, Ingo Molnar wrote:
> 
> * Paul E. McKenney <paulmck@linux.vnet.ibm.com> wrote:
> 
> > And here is a prototype patch, which I intend to merge with the existing patch 
> > that renames rcu_lockdep_assert() to RCU_LOCKDEP_WARN().  I will also queue a 
> > revert of the patch below for 4.4.
> > 
> > Thoughts?
> > 
> > 							Thanx, Paul
> > 
> > ------------------------------------------------------------------------
> > 
> > diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
> > index 41c49b12fe6d..663d6e028c3d 100644
> > --- a/include/linux/rcupdate.h
> > +++ b/include/linux/rcupdate.h
> > @@ -536,9 +536,29 @@ static inline int rcu_read_lock_sched_held(void)
> >  
> >  #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
> >  
> > +/* Deprecate the rcu_lockdep_assert() macro. */
> > +static inline void __attribute((deprecated)) deprecate_rcu_lockdep_assert(void)
> > +{
> > +}
> > +
> >  #ifdef CONFIG_PROVE_RCU
> >  
> >  /**
> > + * rcu_lockdep_assert - emit lockdep splat if specified condition not met
> > + * @c: condition to check
> > + * @s: informative message
> > + */
> > +#define rcu_lockdep_assert(c, s)					\
> > +	do {								\
> > +		static bool __section(.data.unlikely) __warned;		\
> > +		deprecate_rcu_lockdep_assert();				\
> > +		if (debug_lockdep_rcu_enabled() && !__warned && !(c)) {	\
> > +			__warned = true;				\
> > +			lockdep_rcu_suspicious(__FILE__, __LINE__, s);	\
> > +		}							\
> 
> Btw., out of general macro paranoia I'd write such constructs as something like:
> 
> 		if (!(c) && debug_lockdep_rcu_enabled() && !__warned) {	\
> 
> I.e. always evaluate 'c' even if debugging is off. This way if the construct is 
> fed an expression with a side effect (bad idea!) then it still works regardless of 
> whether the warning triggered already or not.

If you feel strongly about this, I will need to make lockdep_is_held()
be defined when lockdep is disabled.  Easy enough to do, just thought
I should double-check.

> But this construct is OK too to me, so feel free to add my:
> 
>   Reviewed-by: Ingo Molnar <mingo@kernel.org>

Thank you!

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

linux-next: build failure after merge of the rcu tree Stephen Rothwell <sfr@canb.auug.org.au> - 2015-07-16 05:20 +0200
  Re: linux-next: build failure after merge of the rcu tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-16 06:00 +0200
    Re: linux-next: build failure after merge of the rcu tree Ingo Molnar <mingo@kernel.org> - 2015-07-17 13:50 +0200
      Re: linux-next: build failure after merge of the rcu tree "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-07-17 23:40 +0200

csiph-web