All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Fengguang Wu <fengguang.wu@intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: lockdep WARNING on check_critical_timing()
Date: Thu, 6 Sep 2012 15:08:21 -0700	[thread overview]
Message-ID: <20120906220821.GO2448@linux.vnet.ibm.com> (raw)
In-Reply-To: <1346968599.1680.55.camel@gandalf.local.home>

On Thu, Sep 06, 2012 at 05:56:39PM -0400, Steven Rostedt wrote:
> On Thu, 2012-09-06 at 14:29 -0700, Paul E. McKenney wrote:
> >  
> > > Didn't we talk about having the rcu_dereference_raw() not do the check?
> > > The function tracer is just too invasive to add work arounds to prevent
> > > lockdep from screaming about it.
> > 
> > Actually, rcu_dereference_raw() is already supposed to bypass the
> > lockdep checks.  And the code looks to me like it does the bypass,
> > OR-ing "1" into the asssertion condition.
> > 
> > So what am I missing here?
> 
> >From my tree, I see:
> 
> #define rcu_dereference_raw(p) rcu_dereference_check(p, 1)
> 
> #define rcu_dereference_check(p, c) \
> 	__rcu_dereference_check((p), rcu_read_lock_held() || (c), __rcu)
> 
> Note the 'c' comes after rcu_read_lock_held()
> 
> static inline int rcu_read_lock_held(void)
> {
> 	if (!debug_lockdep_rcu_enabled())
> 		return 1;
> 	if (rcu_is_cpu_idle())
> 		return 0;
> 	if (!rcu_lockdep_current_cpu_online())
> 		return 0;
> 	return lock_is_held(&rcu_lock_map);
> }
> 
> Then when lock_is_held() is called, we get the false warning message.

OK, I can easily do:

	__rcu_dereference_check((p), (c) || rcu_read_lock_held(), __rcu)

But I am still missing why the order matters.  Are you saying that
lock_is_held() itself is doing the splat?

							Thanx, Paul


      reply	other threads:[~2012-09-06 22:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-05  1:59 lockdep WARNING on check_critical_timing() Fengguang Wu
2012-09-06 21:00 ` Steven Rostedt
2012-09-06 21:29   ` Paul E. McKenney
2012-09-06 21:56     ` Steven Rostedt
2012-09-06 22:08       ` Paul E. McKenney [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120906220821.GO2448@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.