diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 20:57:16 +0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-23 20:57:16 +0400 |
commit | b14ea38e13686799b9d2545d467a0ec84732981c (patch) | |
tree | 0decf621cf4a56eb9c1a2426edb7399bebb4a2e4 | |
parent | 6770ab5cf506f0f00c17a5f063c5506bdc1eb170 (diff) | |
parent | c4bd822e7b12a9008241d76db45b665f2fef180c (diff) | |
download | linux-b14ea38e13686799b9d2545d467a0ec84732981c.tar.xz |
Merge branch 'v28-timers-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* '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
-rw-r--r-- | kernel/time/tick-sched.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 0581c11fe6c6..727c1ae0517a 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -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 |