linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@polymtl.ca,
	josh@joshtriplett.org, niv@us.ibm.com, tglx@linutronix.de,
	peterz@infradead.org, rostedt@goodmis.org,
	Valdis.Kletnieks@vt.edu, dhowells@redhat.com,
	eric.dumazet@gmail.com, darren@dvhart.com, fweisbec@gmail.com,
	sbw@mit.edu, patches@linaro.org
Subject: Re: [PATCH tip/core/rcu 3/5] rcu: Document SRCU dead-CPU capabilities, emphasize read-side limits
Date: Tue, 18 Sep 2012 17:12:16 +0800	[thread overview]
Message-ID: <50583AF0.9050403@cn.fujitsu.com> (raw)
In-Reply-To: <1346352312-31987-3-git-send-email-paulmck@linux.vnet.ibm.com>

On 08/31/2012 02:45 AM, Paul E. McKenney wrote:
> From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
> 
> The current documentation did not help someone grepping for SRCU to
> learn that disabling preemption is not a replacement for srcu_read_lock(),
> so upgrade the documentation to bring this out, not just for SRCU,
> but also for RCU-bh.  Also document the fact that SRCU readers are
> respected on CPUs executing in user mode, idle CPUs, and even on
> offline CPUs.
> 
> Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>

Good.  (Sorry, I'm late.)

Reviewed-by: Lai Jiangshan <laijs@cn.fujitsu.com>

> ---
>  Documentation/RCU/checklist.txt |    6 ++++++
>  Documentation/RCU/whatisRCU.txt |    9 +++++++--
>  2 files changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/RCU/checklist.txt b/Documentation/RCU/checklist.txt
> index fc103d7..cdb20d4 100644
> --- a/Documentation/RCU/checklist.txt
> +++ b/Documentation/RCU/checklist.txt
> @@ -310,6 +310,12 @@ over a rather long period of time, but improvements are always welcome!
>  	code under the influence of preempt_disable(), you instead
>  	need to use synchronize_irq() or synchronize_sched().
>  
> +	This same limitation also applies to synchronize_rcu_bh()
> +	and synchronize_srcu(), as well as to the asynchronous and
> +	expedited forms of the three primitives, namely call_rcu(),
> +	call_rcu_bh(), call_srcu(), synchronize_rcu_expedited(),
> +	synchronize_rcu_bh_expedited(), and synchronize_srcu_expedited().
> +
>  12.	Any lock acquired by an RCU callback must be acquired elsewhere
>  	with softirq disabled, e.g., via spin_lock_irqsave(),
>  	spin_lock_bh(), etc.  Failing to disable irq on a given
> diff --git a/Documentation/RCU/whatisRCU.txt b/Documentation/RCU/whatisRCU.txt
> index 69ee188..bf0f6de 100644
> --- a/Documentation/RCU/whatisRCU.txt
> +++ b/Documentation/RCU/whatisRCU.txt
> @@ -873,7 +873,7 @@ d.	Do you need to treat NMI handlers, hardirq handlers,
>  	and code segments with preemption disabled (whether
>  	via preempt_disable(), local_irq_save(), local_bh_disable(),
>  	or some other mechanism) as if they were explicit RCU readers?
> -	If so, you need RCU-sched.
> +	If so, RCU-sched is the only choice that will work for you.
>  
>  e.	Do you need RCU grace periods to complete even in the face
>  	of softirq monopolization of one or more of the CPUs?  For
> @@ -884,7 +884,12 @@ f.	Is your workload too update-intensive for normal use of
>  	RCU, but inappropriate for other synchronization mechanisms?
>  	If so, consider SLAB_DESTROY_BY_RCU.  But please be careful!
>  
> -g.	Otherwise, use RCU.
> +g.	Do you need read-side critical sections that are respected
> +	even though they are in the middle of the idle loop, during
> +	user-mode execution, or on an offlined CPU?  If so, SRCU is the
> +	only choice that will work for you.
> +
> +h.	Otherwise, use RCU.
>  
>  Of course, this all assumes that you have determined that RCU is in fact
>  the right tool for your job.


  parent reply	other threads:[~2012-09-18  9:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 18:44 [PATCH tip/core/rcu 0/5] Documentation and rcutorture changes Paul E. McKenney
2012-08-30 18:45 ` [PATCH tip/core/rcu 1/5] rcu: Update rcutorture defaults Paul E. McKenney
2012-08-30 18:45   ` [PATCH tip/core/rcu 2/5] rcu: Track CPU-hotplug duration statistics Paul E. McKenney
2012-08-30 19:00     ` Josh Triplett
2012-08-30 20:38       ` Paul E. McKenney
2012-08-30 23:23         ` Josh Triplett
2012-08-30 18:45   ` [PATCH tip/core/rcu 3/5] rcu: Document SRCU dead-CPU capabilities, emphasize read-side limits Paul E. McKenney
2012-08-30 19:01     ` Josh Triplett
2012-09-18  9:12     ` Lai Jiangshan [this message]
2012-09-18 23:32       ` Paul E. McKenney
2012-08-30 18:45   ` [PATCH tip/core/rcu 4/5] rcu: Switch rcutorture to pr_alert() and friends Paul E. McKenney
2012-08-30 19:05     ` Josh Triplett
2012-08-30 18:45   ` [PATCH tip/core/rcu 5/5] rcu: Prevent initialization race in rcutorture kthreads Paul E. McKenney
2012-08-30 19:15     ` Josh Triplett
2012-08-30 18:57   ` [PATCH tip/core/rcu 1/5] rcu: Update rcutorture defaults Josh Triplett
2012-08-30 21:35     ` Paul E. McKenney
2012-08-30 23:24       ` Josh Triplett
2012-08-30 18:56 ` [PATCH tip/core/rcu 0/5] Documentation and rcutorture changes Josh Triplett
2012-08-30 21:46   ` Paul E. McKenney
2012-08-30 23:22     ` Josh Triplett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50583AF0.9050403@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=akpm@linux-foundation.org \
    --cc=darren@dvhart.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=eric.dumazet@gmail.com \
    --cc=fweisbec@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=mingo@elte.hu \
    --cc=niv@us.ibm.com \
    --cc=patches@linaro.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sbw@mit.edu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).