diff options
| author | Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | 2008-09-29 11:06:46 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-09-30 06:08:41 -0400 |
| commit | 1c50b728c3e734150b8a4a8310ce3e01bc5c70be (patch) | |
| tree | a9781d8dcdb575a91e7c9e374977d473b87fcad8 | |
| parent | 3a72dc8eb5a7122fff439a22bd22486a4fff505c (diff) | |
rcu: add rcu_read_lock_sched() / rcu_read_unlock_sched()
Add rcu_read_lock_sched() and rcu_read_unlock_sched() to rcupdate.h to match the
recently added write-side call_rcu_sched() and rcu_barrier_sched(). They also
match the no-so-recently-added synchronize_sched().
It will help following matching use of the update/read lock primitives. Those
new read lock will replace preempt_disable()/enable() used in pair with
RCU-classic synchronization.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
| -rw-r--r-- | include/linux/rcupdate.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index e8b4039cfb2f..86f1f5e43e33 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -133,6 +133,26 @@ struct rcu_head { | |||
| 133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() | 133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() |
| 134 | 134 | ||
| 135 | /** | 135 | /** |
| 136 | * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section | ||
| 137 | * | ||
| 138 | * Should be used with either | ||
| 139 | * - synchronize_sched() | ||
| 140 | * or | ||
| 141 | * - call_rcu_sched() and rcu_barrier_sched() | ||
| 142 | * on the write-side to insure proper synchronization. | ||
| 143 | */ | ||
| 144 | #define rcu_read_lock_sched() preempt_disable() | ||
| 145 | |||
| 146 | /* | ||
| 147 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section | ||
| 148 | * | ||
| 149 | * See rcu_read_lock_sched for more information. | ||
| 150 | */ | ||
| 151 | #define rcu_read_unlock_sched() preempt_enable() | ||
| 152 | |||
| 153 | |||
| 154 | |||
| 155 | /** | ||
| 136 | * rcu_dereference - fetch an RCU-protected pointer in an | 156 | * rcu_dereference - fetch an RCU-protected pointer in an |
| 137 | * RCU read-side critical section. This pointer may later | 157 | * RCU read-side critical section. This pointer may later |
| 138 | * be safely dereferenced. | 158 | * be safely dereferenced. |
