aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
authorLai Jiangshan <laijs@cn.fujitsu.com>2010-03-18 15:25:33 -0400
committerIngo Molnar <mingo@elte.hu>2010-03-18 16:25:32 -0400
commit0cff810f54b3b52075c27f7a7021d5b195264b6c (patch)
tree671189b10e1ac4d12a26d9a337a2ca053faed107 /include/linux/rcupdate.h
parent7f5b774275df8c76a959eae7488128b637fcbfc8 (diff)
rcu: Fix local_irq_disable() CONFIG_PROVE_RCU=y false positives
It is documented that local_irq_disable() also delimits RCU_SCHED read-site critical sections. See the document of synchronize_sched() or Documentation/RCU/whatisRCU.txt. So we have to test irqs_disabled() in rcu_read_lock_sched_held(). Otherwise rcu-lockdep brings incorrect complaint. Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com> Cc: dipankar@in.ibm.com Cc: mathieu.desnoyers@polymtl.ca Cc: josh@joshtriplett.org Cc: dvhltc@us.ibm.com Cc: niv@us.ibm.com Cc: peterz@infradead.org Cc: rostedt@goodmis.org Cc: Valdis.Kletnieks@vt.edu Cc: dhowells@redhat.com Cc: eric.dumazet@gmail.com LKML-Reference: <1268940334-10892-1-git-send-email-paulmck@linux.vnet.ibm.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index e1bdc4bfd275..872a98e13d6a 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -149,7 +149,7 @@ static inline int rcu_read_lock_sched_held(void)
149 return 1; 149 return 1;
150 if (debug_locks) 150 if (debug_locks)
151 lockdep_opinion = lock_is_held(&rcu_sched_lock_map); 151 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
152 return lockdep_opinion || preempt_count() != 0; 152 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
153} 153}
154#else /* #ifdef CONFIG_PREEMPT */ 154#else /* #ifdef CONFIG_PREEMPT */
155static inline int rcu_read_lock_sched_held(void) 155static inline int rcu_read_lock_sched_held(void)
@@ -180,7 +180,7 @@ static inline int rcu_read_lock_bh_held(void)
180#ifdef CONFIG_PREEMPT 180#ifdef CONFIG_PREEMPT
181static inline int rcu_read_lock_sched_held(void) 181static inline int rcu_read_lock_sched_held(void)
182{ 182{
183 return !rcu_scheduler_active || preempt_count() != 0; 183 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled();
184} 184}
185#else /* #ifdef CONFIG_PREEMPT */ 185#else /* #ifdef CONFIG_PREEMPT */
186static inline int rcu_read_lock_sched_held(void) 186static inline int rcu_read_lock_sched_held(void)