From c561c90c968222109241575dee5460426a2e40ea Mon Sep 17 00:00:00 2001 From: Zachary Amsden Date: Sat, 20 May 2006 15:00:24 -0700 Subject: [PATCH] --- yaml --- r: 26872 b: refs/heads/master c: 0662b71322e211dba9a4bc0e6fbca7861a2b5a7d h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/kernel/timer.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 7640b3118dcb..6102d3dbcf8b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8b1ea24c6cc529f6860c458b1c0872f22e74c950 +refs/heads/master: 0662b71322e211dba9a4bc0e6fbca7861a2b5a7d diff --git a/trunk/kernel/timer.c b/trunk/kernel/timer.c index 67eaf0f54096..9e49deed468c 100644 --- a/trunk/kernel/timer.c +++ b/trunk/kernel/timer.c @@ -541,6 +541,22 @@ unsigned long next_timer_interrupt(void) } spin_unlock(&base->lock); + /* + * It can happen that other CPUs service timer IRQs and increment + * jiffies, but we have not yet got a local timer tick to process + * the timer wheels. In that case, the expiry time can be before + * jiffies, but since the high-resolution timer here is relative to + * jiffies, the default expression when high-resolution timers are + * not active, + * + * time_before(MAX_JIFFY_OFFSET + jiffies, expires) + * + * would falsely evaluate to true. If that is the case, just + * return jiffies so that we can immediately fire the local timer + */ + if (time_before(expires, jiffies)) + return jiffies; + if (time_before(hr_expires, expires)) return hr_expires;