mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, peterz@infradead.org,
	rostedt@goodmis.org, dhowells@redhat.com, edumazet@google.com,
	dvhart@linux.intel.com, fweisbec@gmail.com, oleg@redhat.com,
	bobby.prani@gmail.com,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()
Date: Wed,  9 Dec 2015 15:03:00 -0800	[thread overview]
Message-ID: <1449702188-493-3-git-send-email-paulmck@linux.vnet.ibm.com> (raw)
In-Reply-To: <20151209230243.GA32518@linux.vnet.ibm.com>

The memory barrier in rcu_seq_snap() is needed only for grace periods,
so this commit moves it to the grace-period-oriented wrapper
rcu_exp_gp_seq_snap().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
---
 kernel/rcu/tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index bd2605c144cc..a4a0475aede9 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3347,7 +3347,6 @@ static unsigned long rcu_seq_snap(unsigned long *sp)
 {
 	unsigned long s;
 
-	smp_mb(); /* Caller's modifications seen first by other CPUs. */
 	s = (READ_ONCE(*sp) + 3) & ~0x1;
 	smp_mb(); /* Above access must not bleed into critical section. */
 	return s;
@@ -3374,6 +3373,7 @@ static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
 }
 static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
 {
+	smp_mb(); /* Caller's modifications seen first by other CPUs. */
 	return rcu_seq_snap(&rsp->expedited_sequence);
 }
 static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
-- 
2.5.2


  parent reply	other threads:[~2015-12-09 23:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-09 23:02 [PATCH v2 tip/core/rcu 0/11] Expedited-grace-period changes for 4.5 Paul E. McKenney
2015-12-09 23:02 ` [PATCH v2 tip/core/rcu 01/11] rcu: Short-circuit synchronize_sched_expedited() if only one CPU Paul E. McKenney
2015-12-09 23:02 ` [PATCH v2 tip/core/rcu 02/11] rcu: Clarify role of ->expmaskinitnext Paul E. McKenney
2015-12-09 23:03 ` Paul E. McKenney [this message]
2015-12-10 20:29   ` [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap() Peter Zijlstra
2015-12-10 20:41     ` Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 04/11] rcu: Invert sync_rcu_exp_select_cpus() "if" statement Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 05/11] rcu: Reduce expedited GP memory contention via per-CPU variables Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 06/11] rcu: Make expedited grace periods resolve stall-warning ties Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 07/11] rcu: Add more diagnostics to expedited stall warning messages Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 08/11] rcu: Add rcu_normal kernel parameter to suppress expediting Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 09/11] rcu: Wire up rcu_end_inkernel_boot() Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 10/11] rcu: Allow expedited grace periods to be disabled at init Paul E. McKenney
2015-12-09 23:03 ` [PATCH v2 tip/core/rcu 11/11] rcu: Remove TINY_RCU bloat from pointless boot parameters Paul E. McKenney

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=1449702188-493-3-git-send-email-paulmck@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=bobby.prani@gmail.com \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=dvhart@linux.intel.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=josh@joshtriplett.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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

all inboxes | Powered by JetHome®