Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Oct 2003 09:23:51 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Poul-Henning Kamp <phk@phk.freebsd.dk>
Cc:        Nate Lawson <nate@root.org>
Subject:   Re: Variable timer tick rate? 
Message-ID:  <20031019091024.O2998@gamplex.bde.org>
In-Reply-To: <9670.1066507540@critter.freebsd.dk>
References:  <9670.1066507540@critter.freebsd.dk>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 18 Oct 2003, Poul-Henning Kamp wrote:

> In message <20031018130119.T47207@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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031019091024.O2998>