From owner-freebsd-arch@FreeBSD.ORG Sat Oct 18 16:25:31 2003 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 962C916A4B3 for ; Sat, 18 Oct 2003 16:25:31 -0700 (PDT) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23A9143FCB for ; Sat, 18 Oct 2003 16:25:30 -0700 (PDT) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id JAA16145; Sun, 19 Oct 2003 09:25:12 +1000 Date: Sun, 19 Oct 2003 09:23:51 +1000 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Poul-Henning Kamp In-Reply-To: <9670.1066507540@critter.freebsd.dk> Message-ID: <20031019091024.O2998@gamplex.bde.org> References: <9670.1066507540@critter.freebsd.dk> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: arch@freebsd.org cc: Nate Lawson Subject: Re: Variable timer tick rate? X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Oct 2003 23:25:31 -0000 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