summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2003-07-05 22:58:33 -0700
committerIngo Molnar <mingo@elte.hu>2003-07-05 22:58:33 -0700
commite939c913081c23c84e77fc1e5a480b1eead393ee (patch)
treec3be97e5b0b9d64e915add610533b92a8cb7c34b /kernel
parentf0a8aa740a24500b3379396ace6737722d0de1d4 (diff)
[PATCH] another timer overflow thing
in add_timer_internal() we simply leave the timer pending forever if the expiry is in more than 0xffffffff jiffies. This means more than 48 days on eg. ia64 - which is not an unrealistic timeout. IIRC crond is happy to use extremely large timeouts. It's better to time out early (if you can call 48 days "early") than to not time out at all.
Diffstat (limited to 'kernel')
-rw-r--r--kernel/timer.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/kernel/timer.c b/kernel/timer.c
index 7bce7a7cb2c2..3995425e44a5 100644
--- a/kernel/timer.c
+++ b/kernel/timer.c
@@ -126,13 +126,17 @@ static void internal_add_timer(tvec_base_t *base, struct timer_list *timer)
* or you set a timer to go off in the past
*/
vec = base->tv1.vec + (base->timer_jiffies & TVR_MASK);
- } else if (idx <= 0xffffffffUL) {
- int i = (expires >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK;
- vec = base->tv5.vec + i;
} else {
- /* Can only get here on architectures with 64-bit jiffies */
- INIT_LIST_HEAD(&timer->entry);
- return;
+ int i;
+ /* If the timeout is larger than 0xffffffff on 64-bit
+ * architectures then we use the maximum timeout:
+ */
+ if (idx > 0xffffffffUL) {
+ idx = 0xffffffffUL;
+ expires = idx + base->timer_jiffies;
+ }
+ i = (expires >> (TVR_BITS + 3 * TVN_BITS)) & TVN_MASK;
+ vec = base->tv5.vec + i;
}
/*
* Timers are FIFO: