aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-16 19:27:44 -0400
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>2016-03-31 16:34:10 -0400
commit179e5dcd1e5bdfac1128431d131b31322aedd2bc (patch)
tree7900da31bdb0b0e2468c2547e128301af69ec9f9
parent4ea3e85b113ab37a2d55cfabf0d709ddec088bb3 (diff)
rcu: Consolidate expedited GP tracing into rcu_exp_gp_seq_snap()
This commit moves some duplicate code from synchronize_rcu_expedited() and synchronize_sched_expedited() into rcu_exp_gp_seq_snap(). This doesn't save lines of code, but does eliminate a "tell me twice" issue. Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
-rw-r--r--kernel/rcu/tree.c8
-rw-r--r--kernel/rcu/tree_plugin.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index fd86eca9478e..5b1c8fd89af0 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3392,8 +3392,12 @@ static void rcu_exp_gp_seq_end(struct rcu_state *rsp)
3392} 3392}
3393static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp) 3393static unsigned long rcu_exp_gp_seq_snap(struct rcu_state *rsp)
3394{ 3394{
3395 unsigned long s;
3396
3395 smp_mb(); /* Caller's modifications seen first by other CPUs. */ 3397 smp_mb(); /* Caller's modifications seen first by other CPUs. */
3396 return rcu_seq_snap(&rsp->expedited_sequence); 3398 s = rcu_seq_snap(&rsp->expedited_sequence);
3399 trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
3400 return s;
3397} 3401}
3398static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s) 3402static bool rcu_exp_gp_seq_done(struct rcu_state *rsp, unsigned long s)
3399{ 3403{
@@ -3898,8 +3902,6 @@ void synchronize_sched_expedited(void)
3898 3902
3899 /* Take a snapshot of the sequence number. */ 3903 /* Take a snapshot of the sequence number. */
3900 s = rcu_exp_gp_seq_snap(rsp); 3904 s = rcu_exp_gp_seq_snap(rsp);
3901 trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
3902
3903 if (exp_funnel_lock(rsp, s)) 3905 if (exp_funnel_lock(rsp, s))
3904 return; /* Someone else did our work for us. */ 3906 return; /* Someone else did our work for us. */
3905 3907
diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h
index b6d5dde6eab9..529a44085a63 100644
--- a/kernel/rcu/tree_plugin.h
+++ b/kernel/rcu/tree_plugin.h
@@ -748,8 +748,6 @@ void synchronize_rcu_expedited(void)
748 } 748 }
749 749
750 s = rcu_exp_gp_seq_snap(rsp); 750 s = rcu_exp_gp_seq_snap(rsp);
751 trace_rcu_exp_grace_period(rsp->name, s, TPS("snap"));
752
753 if (exp_funnel_lock(rsp, s)) 751 if (exp_funnel_lock(rsp, s))
754 return; /* Someone else did our work for us. */ 752 return; /* Someone else did our work for us. */
755 753