From owner-freebsd-hackers Wed Dec 4 11: 8:49 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 07DD837B401 for ; Wed, 4 Dec 2002 11:08:47 -0800 (PST) Received: from pcwin002.win.tue.nl (pcwin002.win.tue.nl [131.155.71.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id 051FC43ECF for ; Wed, 4 Dec 2002 11:08:46 -0800 (PST) (envelope-from stijn@pcwin002.win.tue.nl) Received: from pcwin002.win.tue.nl (localhost [127.0.0.1]) by pcwin002.win.tue.nl (8.12.6/8.12.6) with ESMTP id gB4J8jmr053128; Wed, 4 Dec 2002 20:08:45 +0100 (CET) (envelope-from stijn@pcwin002.win.tue.nl) Received: (from stijn@localhost) by pcwin002.win.tue.nl (8.12.6/8.12.6/Submit) id gB4J8jvj053127; Wed, 4 Dec 2002 20:08:45 +0100 (CET) Date: Wed, 4 Dec 2002 20:08:45 +0100 From: Stijn Hoop To: Mike Silbersack Cc: hackers@freebsd.org Subject: Re: [nephtes@openface.ca: [Xmame] Use of usleep() with -sleepidle] Message-ID: <20021204190845.GF52541@pcwin002.win.tue.nl> References: <20021202151816.GJ83264@pcwin002.win.tue.nl> <20021202114019.R31106-100000@patrocles.silby.com> <20021204113154.GA205@pcwin002.win.tue.nl> <20021204114915.Q41338-100000@patrocles.silby.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="imjhCm/Pyz7Rq5F2" Content-Disposition: inline In-Reply-To: <20021204114915.Q41338-100000@patrocles.silby.com> User-Agent: Mutt/1.4i X-Bright-Idea: Let's abolish HTML mail! 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 --imjhCm/Pyz7Rq5F2 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Dec 04, 2002 at 12:01:43PM -0600, Mike Silbersack wrote: > 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=3D100, but that the default switched to hz=3D1000 sometime in the = recent > > > past. > > > > And why don't we do the same? (I suspect this is related to the question > > above :) >=20 > 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. OK, thanks for the explanation. This makes sense. > 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. Wel, necessary might be an overstatement but seeing as the overhead of the syscalls decreased this much, it would mean a few more frames per second, yes. > In short, I don't think the issue has been discussed much, partially > because it's so easy for those who want hz=3D1000 to just edit loader.con= f. > If you want to propose that we switch to hz=3D1000 by default: Nah, I'll leave that to someone who has some more expertise in writing benchmarks etc. --Stijn --=20 "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." -- Kristian Wilson, Nintendo, Inc., 1989 --imjhCm/Pyz7Rq5F2 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (FreeBSD) iD8DBQE97lK9Y3r/tLQmfWcRAv9PAKCoUTMcLsStFLi4m5splXIsyXdmfgCgm6Xr vbyco2u3OewLXTWpWo/xQgk= =LFyc -----END PGP SIGNATURE----- --imjhCm/Pyz7Rq5F2-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message