Skip to contentSkip to conversation

Make lockdep-RCU insist on rcu_read_lock_bh()

RFC PATCH New Paul E. McKenney 1 participant 1 message Oct 7, 2011

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 Make lockdep-RCU insist on rcu_read_lock_bh()

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.

kernel/rcupdate.c +4 -0
index 5e0577b..e91a85d 100644
@@ -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