aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/rcu/tree.c
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-04-22 18:06:05 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2018-07-12 17:25:17 -0400
commit18390aeae7010ee56b132dcfb663ba362a099d99 (patch)
tree52282bb131a34abc51599d1aaa71a0da62084f9d /kernel/rcu/tree.c
parent26d950a9451336a6b5abc1c8ca6c21df58e8d89f (diff)
rcu: Make rcu_gp_cleanup() write only once to ->gp_flags
At the end of rcu_gp_cleanup(), if another grace period is needed, but not via rcu_accelerate_cbs(), the ->gp_flags field is written twice, once when making the new grace-period request, and once when clearing all other types of requests. This commit therefore adds an else-clause to avoid this double write. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Diffstat (limited to 'kernel/rcu/tree.c')
-rw-r--r--kernel/rcu/tree.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 6ce82c009195..a9a4a260ea7d 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -2117,8 +2117,9 @@ static void rcu_gp_cleanup(struct rcu_state *rsp)
2117 rsp->gp_req_activity = jiffies; 2117 rsp->gp_req_activity = jiffies;
2118 trace_rcu_grace_period(rsp->name, READ_ONCE(rsp->gpnum), 2118 trace_rcu_grace_period(rsp->name, READ_ONCE(rsp->gpnum),
2119 TPS("newreq")); 2119 TPS("newreq"));
2120 } else {
2121 WRITE_ONCE(rsp->gp_flags, rsp->gp_flags & RCU_GP_FLAG_INIT);
2120 } 2122 }
2121 WRITE_ONCE(rsp->gp_flags, rsp->gp_flags & RCU_GP_FLAG_INIT);
2122 raw_spin_unlock_irq_rcu_node(rnp); 2123 raw_spin_unlock_irq_rcu_node(rnp);
2123} 2124}
2124 2125