]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
rcu: Prohibit grace periods during early boot
authorPaul E. McKenney <paul.mckenney@linaro.org>
Mon, 8 Aug 2011 03:26:31 +0000 (20:26 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Wed, 10 Aug 2011 02:28:46 +0000 (19:28 -0700)
Greater use of RCU during early boot (before the scheduler is operating)
is causing RCU to attempt to start grace periods during that time, which
in turn is resulting in both RCU and the callback functions attempting
to use the scheduler before it is ready.

This commit prevents these problems by prohibiting RCU grace periods
until after the scheduler has spawned the first non-idle task.

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 3fdb61014c022783f8b0d90037e4e7a95a747dd2..309c84da413a12b3c848a4bf1a413a1fd14a6329 100644 (file)
@@ -842,8 +842,11 @@ rcu_start_gp(struct rcu_state *rsp, unsigned long flags)
        struct rcu_data *rdp = this_cpu_ptr(rsp->rda);
        struct rcu_node *rnp = rcu_get_root(rsp);
 
-       if (!cpu_needs_another_gp(rsp, rdp) || rsp->fqs_active) {
-               if (cpu_needs_another_gp(rsp, rdp))
+       if (!rcu_scheduler_fully_active ||
+           !cpu_needs_another_gp(rsp, rdp) ||
+           rsp->fqs_active) {
+               if (rcu_scheduler_fully_active &&
+                   cpu_needs_another_gp(rsp, rdp))
                        rsp->fqs_need_gp = 1;
                if (rnp->completed == rsp->completed) {
                        raw_spin_unlock_irqrestore(&rnp->lock, flags);