rcu: Consolidate expedited GP code into exp_funnel_lock()
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 16 Mar 2016 23:32:24 +0000 (16:32 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 31 Mar 2016 20:34:11 +0000 (13:34 -0700)
This commit pulls the grace-period-start counter adjustment and tracing
from synchronize_rcu_expedited() and synchronize_sched_expedited()
into exp_funnel_lock(), thus eliminating some code duplication.

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcu/tree.c
kernel/rcu/tree_plugin.h

index 5b1c8fd..e8fff14 100644 (file)
@@ -3653,6 +3653,8 @@ fastpath:
                mutex_unlock(&rsp->exp_mutex);
                return true;
        }
+       rcu_exp_gp_seq_start(rsp);
+       trace_rcu_exp_grace_period(rsp->name, s, TPS("start"));
        return false;
 }
 
@@ -3905,9 +3907,6 @@ void synchronize_sched_expedited(void)
        if (exp_funnel_lock(rsp, s))
                return;  /* Someone else did our work for us. */
 
-       rcu_exp_gp_seq_start(rsp);
-       trace_rcu_exp_grace_period(rsp->name, s, TPS("start"));
-
        /* Initialize the rcu_node tree in preparation for the wait. */
        sync_rcu_exp_select_cpus(rsp, sync_sched_exp_handler);
 
index 529a440..ff1cd4e 100644 (file)
@@ -751,9 +751,6 @@ void synchronize_rcu_expedited(void)
        if (exp_funnel_lock(rsp, s))
                return;  /* Someone else did our work for us. */
 
-       rcu_exp_gp_seq_start(rsp);
-       trace_rcu_exp_grace_period(rsp->name, s, TPS("start"));
-
        /* Initialize the rcu_node tree in preparation for the wait. */
        sync_rcu_exp_select_cpus(rsp, sync_rcu_exp_handler);