I think the test whether the timer value is in the past doesn't work
when jiffies overflow (i.e. expires = ULONG_MAX - 5, jiffies = expires
+ 10), but I'm not sure if I really understood what the code is
expected to do.
> ...
> } else if (expires < timer_jiffies) {
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.
Anyone want to work on this, test it, and send me patches for the CVS
tree?
Later,
David "Sparc" Miller
davem@caip.rutgers.edu