rcu: Eliminate check_for_new_grace_period() wrapper function
[firefly-linux-kernel-4.4.55.git] / kernel / rcutree.c
index ac8f03c41476ff996952fc372c4fce5accbea509..b73014998b406ec33ae76e27f0dd73176ffab68b 100644 (file)
@@ -1307,26 +1307,6 @@ static void note_gp_changes(struct rcu_state *rsp, struct rcu_data *rdp)
        raw_spin_unlock_irqrestore(&rnp->lock, flags);
 }
 
-/*
- * Did someone else start a new RCU grace period start since we last
- * checked?  Update local state appropriately if so.  Must be called
- * on the CPU corresponding to rdp.
- */
-static int
-check_for_new_grace_period(struct rcu_state *rsp, struct rcu_data *rdp)
-{
-       unsigned long flags;
-       int ret = 0;
-
-       local_irq_save(flags);
-       if (rdp->gpnum != rsp->gpnum) {
-               note_gp_changes(rsp, rdp);
-               ret = 1;
-       }
-       local_irq_restore(flags);
-       return ret;
-}
-
 /*
  * Do per-CPU grace-period initialization for running CPU.  The caller
  * must hold the lock of the leaf rcu_node structure corresponding to
@@ -1749,8 +1729,10 @@ 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 (check_for_new_grace_period(rsp, rdp))
+       if (rdp->gpnum != rsp->gpnum) {
+               note_gp_changes(rsp, rdp);
                return;
+       }
 
        /*
         * Does this CPU still need to do its part for current grace period?
@@ -2302,7 +2284,6 @@ static void __call_rcu_core(struct rcu_state *rsp, struct rcu_data *rdp,
 
                /* Are we ignoring a completed grace period? */
                note_gp_changes(rsp, rdp);
-               check_for_new_grace_period(rsp, rdp);
 
                /* Start a new grace period if one not already started. */
                if (!rcu_gp_in_progress(rsp)) {