diff options
Diffstat (limited to 'include/linux/rcupdate.h')
-rw-r--r-- | include/linux/rcupdate.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 970284f571a6..b4ca73d65891 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -163,14 +163,22 @@ extern int rcu_needs_cpu(int cpu); | |||
163 | * | 163 | * |
164 | * It is illegal to block while in an RCU read-side critical section. | 164 | * It is illegal to block while in an RCU read-side critical section. |
165 | */ | 165 | */ |
166 | #define rcu_read_lock() preempt_disable() | 166 | #define rcu_read_lock() \ |
167 | do { \ | ||
168 | preempt_disable(); \ | ||
169 | __acquire(RCU); \ | ||
170 | } while(0) | ||
167 | 171 | ||
168 | /** | 172 | /** |
169 | * rcu_read_unlock - marks the end of an RCU read-side critical section. | 173 | * rcu_read_unlock - marks the end of an RCU read-side critical section. |
170 | * | 174 | * |
171 | * See rcu_read_lock() for more information. | 175 | * See rcu_read_lock() for more information. |
172 | */ | 176 | */ |
173 | #define rcu_read_unlock() preempt_enable() | 177 | #define rcu_read_unlock() \ |
178 | do { \ | ||
179 | __release(RCU); \ | ||
180 | preempt_enable(); \ | ||
181 | } while(0) | ||
174 | 182 | ||
175 | /* | 183 | /* |
176 | * So where is rcu_write_lock()? It does not exist, as there is no | 184 | * So where is rcu_write_lock()? It does not exist, as there is no |
@@ -193,14 +201,22 @@ extern int rcu_needs_cpu(int cpu); | |||
193 | * can use just rcu_read_lock(). | 201 | * can use just rcu_read_lock(). |
194 | * | 202 | * |
195 | */ | 203 | */ |
196 | #define rcu_read_lock_bh() local_bh_disable() | 204 | #define rcu_read_lock_bh() \ |
205 | do { \ | ||
206 | local_bh_disable(); \ | ||
207 | __acquire(RCU_BH); \ | ||
208 | } while(0) | ||
197 | 209 | ||
198 | /* | 210 | /* |
199 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section | 211 | * rcu_read_unlock_bh - marks the end of a softirq-only RCU critical section |
200 | * | 212 | * |
201 | * See rcu_read_lock_bh() for more information. | 213 | * See rcu_read_lock_bh() for more information. |
202 | */ | 214 | */ |
203 | #define rcu_read_unlock_bh() local_bh_enable() | 215 | #define rcu_read_unlock_bh() \ |
216 | do { \ | ||
217 | __release(RCU_BH); \ | ||
218 | local_bh_enable(); \ | ||
219 | } while(0) | ||
204 | 220 | ||
205 | /** | 221 | /** |
206 | * rcu_dereference - fetch an RCU-protected pointer in an | 222 | * rcu_dereference - fetch an RCU-protected pointer in an |
@@ -246,7 +262,7 @@ extern int rcu_needs_cpu(int cpu); | |||
246 | * softirq handlers will have completed, since in some kernels, these | 262 | * softirq handlers will have completed, since in some kernels, these |
247 | * handlers can run in process context, and can block. | 263 | * handlers can run in process context, and can block. |
248 | * | 264 | * |
249 | * This primitive provides the guarantees made by the (deprecated) | 265 | * This primitive provides the guarantees made by the (now removed) |
250 | * synchronize_kernel() API. In contrast, synchronize_rcu() only | 266 | * synchronize_kernel() API. In contrast, synchronize_rcu() only |
251 | * guarantees that rcu_read_lock() sections will have completed. | 267 | * guarantees that rcu_read_lock() sections will have completed. |
252 | * In "classic RCU", these two guarantees happen to be one and | 268 | * In "classic RCU", these two guarantees happen to be one and |
@@ -258,13 +274,13 @@ extern void rcu_init(void); | |||
258 | extern void rcu_check_callbacks(int cpu, int user); | 274 | extern void rcu_check_callbacks(int cpu, int user); |
259 | extern void rcu_restart_cpu(int cpu); | 275 | extern void rcu_restart_cpu(int cpu); |
260 | extern long rcu_batches_completed(void); | 276 | extern long rcu_batches_completed(void); |
277 | extern long rcu_batches_completed_bh(void); | ||
261 | 278 | ||
262 | /* Exported interfaces */ | 279 | /* Exported interfaces */ |
263 | extern void FASTCALL(call_rcu(struct rcu_head *head, | 280 | extern void FASTCALL(call_rcu(struct rcu_head *head, |
264 | void (*func)(struct rcu_head *head))); | 281 | void (*func)(struct rcu_head *head))); |
265 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, | 282 | extern void FASTCALL(call_rcu_bh(struct rcu_head *head, |
266 | void (*func)(struct rcu_head *head))); | 283 | void (*func)(struct rcu_head *head))); |
267 | extern __deprecated_for_modules void synchronize_kernel(void); | ||
268 | extern void synchronize_rcu(void); | 284 | extern void synchronize_rcu(void); |
269 | void synchronize_idle(void); | 285 | void synchronize_idle(void); |
270 | extern void rcu_barrier(void); | 286 | extern void rcu_barrier(void); |