]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rcu: Move unanticipated condition from "if" to "WARN_ON()"
authorPaul E. McKenney <paul.mckenney@linaro.org>
Fri, 27 Jul 2012 19:40:30 +0000 (12:40 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Tue, 31 Jul 2012 18:34:18 +0000 (11:34 -0700)
The rcu_preempt_offline_tasks() checks for any of the rcu_node structure's
CPUs still being in an RCU critical section. However, it is extremely
unlikely that any will be due to the fact that all the CPUs must be
offline when this function is called.  This commit therefore moves the
check from the "if" statement to a "WARN_ON()".

Signed-off-by: Paul E. McKenney <paul.mckenney@linaro.org>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
kernel/rcutree_plugin.h

index 7f3244c0df014a7673831159ae1dbc25ceff55c8..a1c8dce925075d256cfc1ec219eb0eec6e3bf9e3 100644 (file)
@@ -551,6 +551,8 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
 
        /* If we are on an internal node, complain bitterly. */
        WARN_ON_ONCE(rnp != rdp->mynode);
+       /* If any offline CPUs are blocking current GP, complain bitterly. */
+       WARN_ON_ONCE(rnp->qsmask != 0);
 
        /*
         * Move tasks up to root rcu_node.  Don't try to get fancy for
@@ -561,7 +563,7 @@ static int rcu_preempt_offline_tasks(struct rcu_state *rsp,
         * absolutely necessary, but this is a good performance/complexity
         * tradeoff.
         */
-       if (rcu_preempt_blocked_readers_cgp(rnp) && rnp->qsmask == 0)
+       if (rcu_preempt_blocked_readers_cgp(rnp))
                retval |= RCU_OFL_TASKS_NORM_GP;
        if (rcu_preempted_readers_exp(rnp))
                retval |= RCU_OFL_TASKS_EXP_GP;