diff options
author | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-11-28 13:42:42 -0500 |
---|---|---|
committer | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | 2011-12-11 13:32:06 -0500 |
commit | 3842a0832a1d6eb0b31421f8810a813135967512 (patch) | |
tree | 67aff02fde9c32e647d7b3c4cea948d7867f664d /include/linux/srcu.h | |
parent | f0e7c19db8798b4b991a2c71911e71f5dfdb348f (diff) |
rcu: Document same-context read-side constraints
The intent is that a given RCU read-side critical section be confined
to a single context. For example, it is illegal to invoke rcu_read_lock()
in an exception handler and then invoke rcu_read_unlock() from the
context of the task that received the exception.
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'include/linux/srcu.h')
-rw-r--r-- | include/linux/srcu.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 1eb520cd1680..e1b005918bbb 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -158,6 +158,11 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp) | |||
158 | * one way to indirectly wait on an SRCU grace period is to acquire | 158 | * one way to indirectly wait on an SRCU grace period is to acquire |
159 | * a mutex that is held elsewhere while calling synchronize_srcu() or | 159 | * a mutex that is held elsewhere while calling synchronize_srcu() or |
160 | * synchronize_srcu_expedited(). | 160 | * synchronize_srcu_expedited(). |
161 | * | ||
162 | * Note that srcu_read_lock() and the matching srcu_read_unlock() must | ||
163 | * occur in the same context, for example, it is illegal to invoke | ||
164 | * srcu_read_unlock() in an irq handler if the matching srcu_read_lock() | ||
165 | * was invoked in process context. | ||
161 | */ | 166 | */ |
162 | static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp) | 167 | static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp) |
163 | { | 168 | { |