public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: rcu@vger.kernel.org, linux-kernel@vger.kernel.org,
	mingo@kernel.org, jiangshanlai@gmail.com, dipankar@in.ibm.com,
	akpm@linux-foundation.org, mathieu.desnoyers@efficios.com,
	josh@joshtriplett.org, tglx@linutronix.de, rostedt@goodmis.org,
	dhowells@redhat.com, edumazet@google.com, fweisbec@gmail.com,
	oleg@redhat.com, joel@joelfernandes.org
Subject: Re: [PATCH tip/core/rcu 6/9] rcu: Upgrade sync_exp_work_done() to smp_mb()
Date: Thu, 13 Jun 2019 15:36:04 -0700	[thread overview]
Message-ID: <20190613223604.GE28207@linux.ibm.com> (raw)
In-Reply-To: <20190606074849.GD3402@hirez.programming.kicks-ass.net>

On Thu, Jun 06, 2019 at 09:48:49AM +0200, Peter Zijlstra wrote:
> On Thu, May 30, 2019 at 08:00:12AM -0700, Paul E. McKenney wrote:
> > The sync_exp_work_done() function uses smp_mb__before_atomic(), but
> > there is no obvious atomic in the ensuing code.  The ordering is
> > absolutely required for grace periods to work correctly, so this
> > commit upgrades the smp_mb__before_atomic() to smp_mb().
> > 
> 
> Did this commit want a Fixes: line? Such that robots can find the right
> kernels to backport this to?

Indeed it does, and thanks to Andrea for finding the commit.

							Thanx, Paul

------------------------------------------------------------------------

commit 96050c68be33edef18800ad6748f61f81db81a20
Author: Paul E. McKenney <paulmck@linux.ibm.com>
Date:   Sat Apr 20 01:40:54 2019 -0700

    rcu: Upgrade sync_exp_work_done() to smp_mb()
    
    The sync_exp_work_done() function uses smp_mb__before_atomic(), but
    there is no obvious atomic in the ensuing code.  The ordering is
    absolutely required for grace periods to work correctly, so this
    commit upgrades the smp_mb__before_atomic() to smp_mb().
    
    Fixes: 6fba2b3767ea ("rcu: Remove deprecated RCU debugfs tracing code")
    Reported-by: Andrea Parri <andrea.parri@amarulasolutions.com>
    Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com>

diff --git a/kernel/rcu/tree_exp.h b/kernel/rcu/tree_exp.h
index 9c990df880d1..d969650a72c6 100644
--- a/kernel/rcu/tree_exp.h
+++ b/kernel/rcu/tree_exp.h
@@ -259,8 +259,7 @@ static bool sync_exp_work_done(unsigned long s)
 {
 	if (rcu_exp_gp_seq_done(s)) {
 		trace_rcu_exp_grace_period(rcu_state.name, s, TPS("done"));
-		/* Ensure test happens before caller kfree(). */
-		smp_mb__before_atomic(); /* ^^^ */
+		smp_mb(); /* Ensure test happens before caller kfree(). */
 		return true;
 	}
 	return false;

  reply	other threads:[~2019-06-13 22:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-30 14:59 [PATCH tip/core/rcu 0/9] Miscellaneous fixes for v5.3 Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 1/9] rcu: Dump specified number of blocked tasks Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 2/9] rcu: Correctly unlock root node in rcu_check_gp_start_stall() Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 3/9] rcu: Make kfree_rcu() ignore NULL pointers Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 4/9] rcu: Set a maximum limit for back-to-back callback invocation Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 5/9] doc: Remove ".vnet" from paulmck email addresses Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 6/9] rcu: Upgrade sync_exp_work_done() to smp_mb() Paul E. McKenney
2019-06-06  7:48   ` Peter Zijlstra
2019-06-13 22:36     ` Paul E. McKenney [this message]
2019-05-30 15:00 ` [PATCH tip/core/rcu 7/9] rcu: Fix irritating whitespace error in rcu_assign_pointer() Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 8/9] rcu: Force inlining of rcu_read_lock() Paul E. McKenney
2019-05-30 15:00 ` [PATCH tip/core/rcu 9/9] rcu: Don't return a value from rcu_assign_pointer() 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=20190613223604.GE28207@linux.ibm.com \
    --to=paulmck@linux.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=dipankar@in.ibm.com \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=jiangshanlai@gmail.com \
    --cc=joel@joelfernandes.org \
    --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=rcu@vger.kernel.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