diff options
Diffstat (limited to 'include/linux/rcupdate.h')
| -rw-r--r-- | include/linux/rcupdate.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 6312758393b6..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 |
| @@ -258,6 +274,7 @@ 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, |
