X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=kernel%2Ftimer.c;h=9e49deed468cd8b2e63f2033d2971d961edeb110;hb=69eb887b0c2380791d33f7c07bfba88d7c5cef15;hp=67eaf0f54096f87162a96daad0b50df11fe5653f;hpb=a82642fa190029a438c0d09edb0e5463a0fe9e1e;p=linux-2.6 diff --git a/kernel/timer.c b/kernel/timer.c index 67eaf0f540..9e49deed46 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -541,6 +541,22 @@ found: } 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;