From c7640680b8c69b8f1ff08efb5ab4f0113b652d76 Mon Sep 17 00:00:00 2001 From: Thomas Gleixner Date: Fri, 25 May 2012 22:08:59 +0000 Subject: [PATCH] --- yaml --- r: 312378 b: refs/heads/master c: e40468a54882ef7411fb178dbf2e465ec2349af7 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/timer.c | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/[refs] b/[refs] index fcaaa6b63d14..8558e852211b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 99d5f3aac674fe081ffddd2dbb8946ccbc14c410 +refs/heads/master: e40468a54882ef7411fb178dbf2e465ec2349af7 diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c index 7fada698bd1a..a61c09374eba 100644 --- a/trunk/kernel/timer.c +++ b/trunk/kernel/timer.c @@ -1326,18 +1326,21 @@ static unsigned long cmp_next_hrtimer_event(unsigned long now, unsigned long get_next_timer_interrupt(unsigned long now) { struct tvec_base *base = __this_cpu_read(tvec_bases); - unsigned long expires; + unsigned long expires = now + NEXT_TIMER_MAX_DELTA; /* * Pretend that there is no timer pending if the cpu is offline. * Possible pending timers will be migrated later to an active cpu. */ if (cpu_is_offline(smp_processor_id())) - return now + NEXT_TIMER_MAX_DELTA; + return expires; + spin_lock(&base->lock); - if (time_before_eq(base->next_timer, base->timer_jiffies)) - base->next_timer = __next_timer_interrupt(base); - expires = base->next_timer; + if (base->active_timers) { + if (time_before_eq(base->next_timer, base->timer_jiffies)) + base->next_timer = __next_timer_interrupt(base); + expires = base->next_timer; + } spin_unlock(&base->lock); if (time_before_eq(expires, now))