]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rcu: Prevent early boot set_need_resched() from __rcu_pending()
authorPaul E. McKenney <paul.mckenney@linaro.org>
Thu, 4 Aug 2011 13:59:03 +0000 (06:59 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 10 Aug 2011 02:28:44 +0000 (19:28 -0700)
There isn't a whole lot of point in poking the scheduler before there
are other tasks to switch to.  This commit therefore adds a check
for rcu_scheduler_fully_active in __rcu_pending() to suppress any
pre-scheduler calls to set_need_resched().  The downside of this approach
is additional runtime overhead in a reasonably hot code path.

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

index 710b1ab5a7b17a41cc75765780c8e2db2f7d7f95..3fdb61014c022783f8b0d90037e4e7a95a747dd2 100644 (file)
@@ -1711,7 +1711,8 @@ static int __rcu_pending(struct rcu_state *rsp, struct rcu_data *rdp)
        check_cpu_stall(rsp, rdp);
 
        /* Is the RCU core waiting for a quiescent state from this CPU? */
-       if (rdp->qs_pending && !rdp->passed_quiesce) {
+       if (rcu_scheduler_fully_active &&
+           rdp->qs_pending && !rdp->passed_quiesce) {
 
                /*
                 * If force_quiescent_state() coming soon and this CPU