]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'v28-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 23 Oct 2008 16:57:16 +0000 (09:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 23 Oct 2008 16:57:16 +0000 (09:57 -0700)
* 'v28-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  NOHZ: fix thinko in the timer restart code path

kernel/time/tick-sched.c

index 0581c11fe6c6765121a84f531475e0e3c78809b3..727c1ae0517ae68f02b6ba6fa0830b45a6213aab 100644 (file)
@@ -567,11 +567,21 @@ static void tick_nohz_switch_to_nohz(void)
 static void tick_nohz_kick_tick(int cpu)
 {
        struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu);
+       ktime_t delta, now;
 
        if (!ts->tick_stopped)
                return;
 
-       tick_nohz_restart(ts, ktime_get());
+       /*
+        * Do not touch the tick device, when the next expiry is either
+        * already reached or less/equal than the tick period.
+        */
+       now = ktime_get();
+       delta = ktime_sub(ts->sched_timer.expires, now);
+       if (delta.tv64 <= tick_period.tv64)
+               return;
+
+       tick_nohz_restart(ts, now);
 }
 
 #else