rcu: Make rcu_enter_nohz() pay attention to nesting
authorPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Mon, 16 May 2011 21:27:31 +0000 (14:27 -0700)
committerPaul E. McKenney <paulmck@linux.vnet.ibm.com>
Thu, 26 May 2011 16:42:22 +0000 (09:42 -0700)
The old version of rcu_enter_nohz() forced RCU into nohz mode even if
the nesting count was non-zero.  This change causes rcu_enter_nohz()
to hold off for non-zero nesting counts.

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

index 195b3a3..99c6038 100644 (file)
@@ -324,8 +324,8 @@ void rcu_enter_nohz(void)
        smp_mb(); /* CPUs seeing ++ must see prior RCU read-side crit sects */
        local_irq_save(flags);
        rdtp = &__get_cpu_var(rcu_dynticks);
-       rdtp->dynticks++;
-       rdtp->dynticks_nesting--;
+       if (--rdtp->dynticks_nesting == 0)
+               rdtp->dynticks++;
        WARN_ON_ONCE(rdtp->dynticks & 0x1);
        local_irq_restore(flags);
 }