linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: tglx@linutronix.de, peterz@infradead.org
Cc: linux-rt-users@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH, RFC, -rt] Make lockdep-RCU insist on rcu_read_lock_bh()
Date: Thu, 6 Oct 2011 17:44:51 -0700	[thread overview]
Message-ID: <20111007004451.GA13738@linux.vnet.ibm.com> (raw)

rcu: Make -rt complain about lack of rcu_read_lock_bh()

Mainline permits local_bh_disable() to be used in place of
rcu_read_lock_bh(), but this fails for CONFIG_PREEMPT_RT_FULL.  This
commit therefore makes rcu_read_lock_bh_held() insist on
rcu_read_lock_bh() for CONFIG_PREEMPT_RT_FULL.

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c
index 5e0577b..e91a85d 100644
--- a/kernel/rcupdate.c
+++ b/kernel/rcupdate.c
@@ -89,7 +89,11 @@ int rcu_read_lock_bh_held(void)
 {
 	if (!debug_lockdep_rcu_enabled())
 		return 1;
+#ifdef CONFIG_PREEMPT_RT_FULL
+	return lock_is_held(&rcu_bh_lock_map);
+#else
 	return in_softirq() || irqs_disabled();
+#endif
 }
 EXPORT_SYMBOL_GPL(rcu_read_lock_bh_held);
 #endif


                 reply	other threads:[~2011-10-07  0:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20111007004451.GA13738@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).