Re: Bug in internal_add_timer()?

Theodore Y. Ts'o (tytso@MIT.EDU)
Tue, 7 Oct 1997 18:42:18 -0400


Date: Tue, 7 Oct 1997 14:21:07 -0400
From: "David S. Miller" <davem@jenolan.rutgers.edu>

Yes I think you're right, it will act incorrectly when jiffies
overflows. Probably a fix is to go:

} else if (((long)expires - (long)timer_jiffies) < 0) {

This is an old trick stolen from the TCP stack. We'd have to do
something similar to this in a whole bunch of other places. I also
bet there are a lot of assumptions which would make this technique not
quite work in a few places.

In the hope of preserving state, I'll replay a suggestion which has come
up the last time we've talked about the jiffies overflow problem:

Modify the kernel to set the jiffies counter to "(unsigned) -300" at
bootup, and then adjust the time routines appropriately. This will
cause the jiffies overflow condition to happen very shortly after boot,
which may help identifying any problem cases we might have.

In fact, it might be a good thing to do by default in the 2.1 kernel
series.....

- Ted