Subject: Re: Improved callout() code
To: David Laight <david@l8s.co.uk>
From: Charles M. Hannum <abuse@spamalicious.com>
List: tech-kern
Date: 10/24/2002 14:21:55
This amuses me a bit.  If you look back in the archives, you'll find
that I actually implemented this once myself, but nobody seemed to be
interested in it at the time.

A few things:

1) You should note that the execution time of a callout is O(log t)
   with this structure.

2) The list reversal only occurs because you (gratuitously) switched
   from TAILQs to LISTs.  This is silly, as the savings in both memory
   and execution overhead is very small.  Also, this may lead to
   unexpected behavior, such as TCP retransmissions swapping order
   each time.

3) The logic actually gets a bit simpler (in particular, you don't
   have to do any distance tests when pulling entries up to a closer
   bucket) if you have the bucket hierarchy extend to the end of time
   (which is, IIRC, INT_MAX, because that's the maximum value hzto()
   will return).