diff options
Diffstat (limited to 'kernel/timer.c')
-rw-r--r-- | kernel/timer.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/timer.c b/kernel/timer.c index 883773788836..9e49deed468c 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -541,6 +541,22 @@ found: | |||
541 | } | 541 | } |
542 | spin_unlock(&base->lock); | 542 | spin_unlock(&base->lock); |
543 | 543 | ||
544 | /* | ||
545 | * It can happen that other CPUs service timer IRQs and increment | ||
546 | * jiffies, but we have not yet got a local timer tick to process | ||
547 | * the timer wheels. In that case, the expiry time can be before | ||
548 | * jiffies, but since the high-resolution timer here is relative to | ||
549 | * jiffies, the default expression when high-resolution timers are | ||
550 | * not active, | ||
551 | * | ||
552 | * time_before(MAX_JIFFY_OFFSET + jiffies, expires) | ||
553 | * | ||
554 | * would falsely evaluate to true. If that is the case, just | ||
555 | * return jiffies so that we can immediately fire the local timer | ||
556 | */ | ||
557 | if (time_before(expires, jiffies)) | ||
558 | return jiffies; | ||
559 | |||
544 | if (time_before(hr_expires, expires)) | 560 | if (time_before(hr_expires, expires)) |
545 | return hr_expires; | 561 | return hr_expires; |
546 | 562 | ||
@@ -1314,7 +1330,7 @@ static void __devinit migrate_timers(int cpu) | |||
1314 | } | 1330 | } |
1315 | #endif /* CONFIG_HOTPLUG_CPU */ | 1331 | #endif /* CONFIG_HOTPLUG_CPU */ |
1316 | 1332 | ||
1317 | static int __devinit timer_cpu_notify(struct notifier_block *self, | 1333 | static int timer_cpu_notify(struct notifier_block *self, |
1318 | unsigned long action, void *hcpu) | 1334 | unsigned long action, void *hcpu) |
1319 | { | 1335 | { |
1320 | long cpu = (long)hcpu; | 1336 | long cpu = (long)hcpu; |
@@ -1334,7 +1350,7 @@ static int __devinit timer_cpu_notify(struct notifier_block *self, | |||
1334 | return NOTIFY_OK; | 1350 | return NOTIFY_OK; |
1335 | } | 1351 | } |
1336 | 1352 | ||
1337 | static struct notifier_block __devinitdata timers_nb = { | 1353 | static struct notifier_block timers_nb = { |
1338 | .notifier_call = timer_cpu_notify, | 1354 | .notifier_call = timer_cpu_notify, |
1339 | }; | 1355 | }; |
1340 | 1356 | ||