]> git.karo-electronics.de Git - linux-beck.git/commitdiff
rcu: Move redundant call to note_gp_changes() into called function
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 19 Mar 2013 19:38:24 +0000 (12:38 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 10 Jun 2013 20:39:44 +0000 (13:39 -0700)
The __rcu_process_callbacks() invokes note_gp_changes() immediately
before invoking rcu_check_quiescent_state(), which conditionally
invokes that same function.  This commit therefore eliminates the
call to note_gp_changes() in __rcu_process_callbacks() in favor of
making unconditional to call from rcu_check_quiescent_state() to
note_gp_changes().

Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Reviewed-by: Josh Triplett <josh@joshtriplett.org>
kernel/rcutree.c

index 391bd724cd77bc8eba5fdb9a2bd909506c1a55c4..7a5194ef90da72b6d35344a4dd61cdeb011b0290 100644 (file)
@@ -1716,11 +1716,8 @@ rcu_report_qs_rdp(int cpu, struct rcu_state *rsp, struct rcu_data *rdp)
 static void
 rcu_check_quiescent_state(struct rcu_state *rsp, struct rcu_data *rdp)
 {
-       /* If there is now a new grace period, record and return. */
-       if (rdp->gpnum != rsp->gpnum) {
-               note_gp_changes(rsp, rdp);
-               return;
-       }
+       /* Check for grace-period ends and beginnings. */
+       note_gp_changes(rsp, rdp);
 
        /*
         * Does this CPU still need to do its part for current grace period?
@@ -2184,9 +2181,6 @@ __rcu_process_callbacks(struct rcu_state *rsp)
 
        WARN_ON_ONCE(rdp->beenonline == 0);
 
-       /* Handle the end of a grace period that some other CPU ended.  */
-       note_gp_changes(rsp, rdp);
-
        /* Update RCU state based on any recent quiescent states. */
        rcu_check_quiescent_state(rsp, rdp);