aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.ibm.com>2019-04-20 04:40:54 -0400
committerPaul E. McKenney <paulmck@linux.ibm.com>2019-06-13 18:33:19 -0400
commit96050c68be33edef18800ad6748f61f81db81a20 (patch)
tree94532580e0cca9f5d078de4548cf03b2efbbd04a
parent714b6904e23e1c37f262a4cd02b34d0f1863e227 (diff)
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>
-rw-r--r--kernel/rcu/tree_exp.h3
1 files changed, 1 insertions, 2 deletions
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)
259{ 259{
260 if (rcu_exp_gp_seq_done(s)) { 260 if (rcu_exp_gp_seq_done(s)) {
261 trace_rcu_exp_grace_period(rcu_state.name, s, TPS("done")); 261 trace_rcu_exp_grace_period(rcu_state.name, s, TPS("done"));
262 /* Ensure test happens before caller kfree(). */ 262 smp_mb(); /* Ensure test happens before caller kfree(). */
263 smp_mb__before_atomic(); /* ^^^ */
264 return true; 263 return true;
265 } 264 }
266 return false; 265 return false;