Signed-off-by: Andrew Morton --- 25-akpm/kernel/timer.c | 18 +++++++++++++----- 1 files changed, 13 insertions(+), 5 deletions(-) diff -puN kernel/timer.c~reduce-false-timer_softirq-calls-tweaks kernel/timer.c --- 25/kernel/timer.c~reduce-false-timer_softirq-calls-tweaks 2004-11-30 01:23:08.717441856 -0800 +++ 25-akpm/kernel/timer.c 2004-11-30 01:23:08.722441096 -0800 @@ -65,7 +65,8 @@ typedef struct tvec_root_s { struct tvec_t_base_s { spinlock_t lock; - unsigned long timer_jiffies, timer_expires; + unsigned long timer_jiffies; + unsigned long timer_expires; /* When we expect the next expiry */ struct timer_list *running_timer; tvec_root_t tv1; tvec_t tv2; @@ -480,11 +481,18 @@ repeat: } set_running_timer(base, NULL); + /* + * Scan through the vector array looking for the next-to-expire timer + * and update ->timer_expires appropriately + */ expires = base->timer_jiffies; - for (probes = 65; --probes && - (expires & TVR_MASK) && - list_empty(base->tv1.vec + (expires & TVR_MASK)); - ++expires); + for (probes = 0; probes < 64; probes++) { + if (!(expires & TVR_MASK)) + break; + if (!list_empty(base->tv1.vec + (expires & TVR_MASK))) + break; + expires++; + } base->timer_expires = expires; spin_unlock_irq(&base->lock); _