From owner-freebsd-hackers Wed Dec 4 9:54:30 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 08C3537B401 for ; Wed, 4 Dec 2002 09:54:29 -0800 (PST) Received: from out4.mx.nwbl.wi.voyager.net (out4.mx.nwbl.wi.voyager.net [169.207.3.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id 72F2643EA9 for ; Wed, 4 Dec 2002 09:54:28 -0800 (PST) (envelope-from silby@silby.com) Received: from [10.1.1.6] (d130.as6.nwbl0.wi.voyager.net [169.207.130.4]) by out4.mx.nwbl.wi.voyager.net (Postfix) with ESMTP id 7F622C3E9B; Wed, 4 Dec 2002 11:54:26 -0600 (CST) Date: Wed, 4 Dec 2002 12:01:43 -0600 (CST) From: Mike Silbersack To: Stijn Hoop Cc: freebsd-hackers@freebsd.org Subject: Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle] In-Reply-To: <20021204113154.GA205@pcwin002.win.tue.nl> Message-ID: <20021204114915.Q41338-100000@patrocles.silby.com> References: <20021202151816.GJ83264@pcwin002.win.tue.nl> <20021202114019.R31106-100000@patrocles.silby.com> <20021204113154.GA205@pcwin002.win.tue.nl> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, 4 Dec 2002, Stijn Hoop wrote: > With the mentioned change of /etc/sysctl.conf to /boot/loader.conf, I am > indeed seeing much better times on this 'benchmark'. See attached log. Not > only the _select_sleep method benefits from this. What are the reasons *not* > to do this? > > > As to why Linux may appear "better"... I believe that Linux defaults to > > hz=100, but that the default switched to hz=1000 sometime in the recent > > past. > > And why don't we do the same? (I suspect this is related to the question > above :) Well, it's generally believed that in the common case (around 100 processes, and/or with well behaved processes that voluntarily give up their timeslice) that 100 context switches per second is enough for smooth performance. Whether this is true or not as you hit 500+ processes on a busy server is unknown, I don't believe that anyone has done benchmarking. One argument against more frequent context switches when you have < 100 processes is that you will be invalidating the contents of the various caches more often, leading to less efficient overall performance. The same argument could also be made for the VM system if the system is under memory pressure. On the other hand, a higher HZ should create a system which runs a bit smoother for interactive programs. And, as you point out, it is necessary for good timing in emulators / simulators / dummynet. In short, I don't think the issue has been discussed much, partially because it's so easy for those who want hz=1000 to just edit loader.conf. If you want to propose that we switch to hz=1000 by default: 1. Make a list of applications / setups that benefit from hz=1000. 2. Wait until after 5.0-release is out the door. 3. Pose your question on -arch. Good luck. :) Mike "Silby" Silbersack To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message