Re: [PATCH tip/core/rcu 09/10] rcu: update obsolete rcu_read_lock() comment.

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Paul E. McKenney
Date: Monday, August 16, 2010 - 10:55 am

On Mon, Aug 16, 2010 at 10:45:32AM -0400, Mathieu Desnoyers wrote:

Thank you for looking this over!

I am updating the srcu_read_lock() docbook comments to call out the
potential for this problem, given that SRCU read-side critical sections
can acquire mutexes, which can be held across both synchronize_srcu()
and synchronize_srcu_expedited().

Seem reasonable?

							Thanx, Paul

diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 6f456a7..58971e8 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -139,7 +139,12 @@ static inline int srcu_read_lock_held(struct srcu_struct *sp)
  * @sp: srcu_struct in which to register the new reader.
  *
  * Enter an SRCU read-side critical section.  Note that SRCU read-side
- * critical sections may be nested.
+ * critical sections may be nested.  However, it is illegal to
+ * call anything that waits on an SRCU grace period for the same
+ * srcu_struct, whether directly or indirectly.  Please note that
+ * one way to indirectly wait on an SRCU grace period is to acquire
+ * a mutex that is held elsewhere while calling synchronize_srcu() or
+ * synchronize_srcu_expedited().
  */
 static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp)
 {

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH tip/core/rcu 01/10] rcu head remove init, Paul E. McKenney, (Mon Aug 9, 3:15 pm)
[PATCH tip/core/rcu 07/10] rcu: Fix RCU_FANOUT help message, Paul E. McKenney, (Mon Aug 9, 3:15 pm)
[PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Mon Aug 9, 3:15 pm)
Re: [PATCH tip/core/rcu 09/10] rcu: update obsolete rcu_re ..., Mathieu Desnoyers, (Mon Aug 16, 7:45 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Mon Aug 16, 8:07 am)
Re: [PATCH tip/core/rcu 09/10] rcu: update obsolete rcu_re ..., Paul E. McKenney, (Mon Aug 16, 10:55 am)
Re: [PATCH tip/core/rcu 09/10] rcu: update obsolete rcu_re ..., Mathieu Desnoyers, (Mon Aug 16, 11:24 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Mon Aug 16, 11:33 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Mon Aug 16, 12:19 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Mon Aug 16, 2:32 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Mon Aug 16, 2:41 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Mon Aug 16, 2:55 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Mon Aug 16, 3:07 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Mon Aug 16, 3:24 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Steven Rostedt, (Tue Aug 17, 6:27 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Tue Aug 17, 7:16 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Tue Aug 17, 7:35 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Steven Rostedt, (Tue Aug 17, 7:54 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Tue Aug 17, 8:55 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Steven Rostedt, (Tue Aug 17, 9:04 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Steven Rostedt, (Tue Aug 17, 9:06 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Mathieu Desnoyers, (Tue Aug 17, 9:25 am)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Tue Aug 17, 12:33 pm)
Re: [PATCH tip/core/rcu 08/10] rcu: Add a TINY_PREEMPT_RCU, Paul E. McKenney, (Tue Aug 17, 1:00 pm)