[PATCH] NOHZ: Fix RCU handling
authorIngo Molnar <mingo@elte.hu>
Mon, 19 Feb 2007 18:11:56 +0000 (18:11 +0000)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 19 Feb 2007 22:18:43 +0000 (14:18 -0800)
When a CPU is needed for RCU the tick has to continue even when it was
stopped before.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/time/tick-sched.c

index 95e41f7f850b46762fa882c81cb4e4f2652c686c..9234e44fc94a8b43a205ba77da11d17fa8321877 100644 (file)
@@ -191,19 +191,19 @@ void tick_nohz_stop_sched_tick(void)
        next_jiffies = get_next_timer_interrupt(last_jiffies);
        delta_jiffies = next_jiffies - last_jiffies;
 
+       if (rcu_needs_cpu(cpu))
+               delta_jiffies = 1;
        /*
         * Do not stop the tick, if we are only one off
         * or if the cpu is required for rcu
         */
-       if (!ts->tick_stopped && (delta_jiffies == 1 || rcu_needs_cpu(cpu)))
+       if (!ts->tick_stopped && delta_jiffies == 1)
                goto out;
 
        /* Schedule the tick, if we are at least one jiffie off */
        if ((long)delta_jiffies >= 1) {
 
-               if (rcu_needs_cpu(cpu))
-                       delta_jiffies = 1;
-               else
+               if (delta_jiffies > 1)
                        cpu_set(cpu, nohz_cpu_mask);
                /*
                 * nohz_stop_sched_tick can be called several times before