Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1287988 > unrolled thread

[PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()

Started by"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
First post2015-12-10 00:10 +0100
Last post2015-12-10 21:50 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 00:10 +0100
    Re: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from  rcu_seq_snap() to rcu_exp_gp_seq_snap() Peter Zijlstra <peterz@infradead.org> - 2015-12-10 21:40 +0100
      Re: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from  rcu_seq_snap() to rcu_exp_gp_seq_snap() "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-12-10 21:50 +0100

#1287988 — [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 00:10 +0100
Subject[PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()
Message-ID<qDW1Z-6ob-43@gated-at.bofh.it>
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

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1288910 — Re: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()

FromPeter Zijlstra <peterz@infradead.org>
Date2015-12-10 21:40 +0100
SubjectRe: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()
Message-ID<qEgam-2C0-29@gated-at.bofh.it>
In reply to#1287988
On Wed, Dec 09, 2015 at 03:03:00PM -0800, Paul E. McKenney wrote:
> 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().

This is a bit short for a memory barrier changelog. I think I remember
enough of the code to see this is indeed so, but who knows who will
remember what in another few weeks :-)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1288916 — Re: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()

From"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Date2015-12-10 21:50 +0100
SubjectRe: [PATCH v2 tip/core/rcu 03/11] rcu: Move smp_mb() from rcu_seq_snap() to rcu_exp_gp_seq_snap()
Message-ID<qEgk2-2GK-9@gated-at.bofh.it>
In reply to#1288910
On Thu, Dec 10, 2015 at 09:29:39PM +0100, Peter Zijlstra wrote:
> On Wed, Dec 09, 2015 at 03:03:00PM -0800, Paul E. McKenney wrote:
> > 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().
> 
> This is a bit short for a memory barrier changelog. I think I remember
> enough of the code to see this is indeed so, but who knows who will
> remember what in another few weeks :-)

;-)

Would it help to add something like the following?

	This change does not add or remove a memory barrier, but instead
	associates it with the right level of abstraction.

							Thanx, Paul

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web