Variable timer tick rate?

Bruce Evans bde at zeta.org.au
Sat Oct 18 16:25:31 PDT 2003


On Sat, 18 Oct 2003, Poul-Henning Kamp wrote:

> In message <20031018130119.T47207 at root.org>, Nate Lawson writes:
>
> >This is an interesting approach.  If there are no upcoming timeouts,
> >decrease the tick rate.  Of course, you have to amortize the cost of
> >resetting the timer over the period of no ticks.
> >
> >http://kerneltrap.org/node/view/1006

Doing this to increase (instead of decrease) the tick rate is an old
topic.  I think it would have too high an overhead (at least for the
increase case, at least on i386's), since reprogramming the i8254
timer takes a few usec.  A few usec every 1/HZ for the default HZ
wouldn't be too bad.

> Yes, unfortunately we may have a couple of timeout() (ab)users which
> use it to implement "as fast as possible polling" by calling timeout
> with a 1 tick argument, so last I looked (a couple of years ago)
> it fired every tick.

Also, some things like to increase HZ to 1000 or more to poll faster,
so even the timeout users that don't know better than to use a timeout
of 1 tick get faster polling.

Bruce


More information about the freebsd-arch mailing list