aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/rcupdate.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r--include/linux/rcupdate.h23
1 files changed, 6 insertions, 17 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 3024050c82a1..872a98e13d6a 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -123,22 +123,11 @@ static inline int rcu_read_lock_held(void)
123 return lock_is_held(&rcu_lock_map); 123 return lock_is_held(&rcu_lock_map);
124} 124}
125 125
126/** 126/*
127 * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? 127 * rcu_read_lock_bh_held() is defined out of line to avoid #include-file
128 * 128 * hell.
129 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in
130 * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING,
131 * this assumes we are in an RCU-bh read-side critical section unless it can
132 * prove otherwise.
133 *
134 * Check rcu_scheduler_active to prevent false positives during boot.
135 */ 129 */
136static inline int rcu_read_lock_bh_held(void) 130extern int rcu_read_lock_bh_held(void);
137{
138 if (!debug_lockdep_rcu_enabled())
139 return 1;
140 return lock_is_held(&rcu_bh_lock_map);
141}
142 131
143/** 132/**
144 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? 133 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section?
@@ -160,7 +149,7 @@ static inline int rcu_read_lock_sched_held(void)
160 return 1; 149 return 1;
161 if (debug_locks) 150 if (debug_locks)
162 lockdep_opinion = lock_is_held(&rcu_sched_lock_map); 151 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
163 return lockdep_opinion || preempt_count() != 0; 152 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
164} 153}
165#else /* #ifdef CONFIG_PREEMPT */ 154#else /* #ifdef CONFIG_PREEMPT */
166static inline int rcu_read_lock_sched_held(void) 155static inline int rcu_read_lock_sched_held(void)
@@ -191,7 +180,7 @@ static inline int rcu_read_lock_bh_held(void)
191#ifdef CONFIG_PREEMPT 180#ifdef CONFIG_PREEMPT
192static inline int rcu_read_lock_sched_held(void) 181static inline int rcu_read_lock_sched_held(void)
193{ 182{
194 return !rcu_scheduler_active || preempt_count() != 0; 183 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled();
195} 184}
196#else /* #ifdef CONFIG_PREEMPT */ 185#else /* #ifdef CONFIG_PREEMPT */
197static inline int rcu_read_lock_sched_held(void) 186static inline int rcu_read_lock_sched_held(void)