From owner-freebsd-hackers@FreeBSD.ORG Tue Aug 5 22:54:03 2003 Return-Path: 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 55E1637B401; Tue, 5 Aug 2003 22:54:03 -0700 (PDT) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mx1.FreeBSD.org (Postfix) with ESMTP id A048743F93; Tue, 5 Aug 2003 22:54:02 -0700 (PDT) (envelope-from eischen@vigrid.com) Received: from mail.pcnet.com (mail.pcnet.com [204.213.232.4]) by mail.pcnet.com (8.12.8/8.12.1) with ESMTP id h765s1uN011835; Wed, 6 Aug 2003 01:54:01 -0400 (EDT) Date: Wed, 6 Aug 2003 01:54:01 -0400 (EDT) From: Daniel Eischen X-Sender: eischen@pcnet5.pcnet.com To: David Schultz In-Reply-To: <20030806044351.GA3881@HAL9000.homeunix.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-hackers@freebsd.org cc: Roderick van Domburg Subject: Re: Tuning HZ for semi-realtime applications X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: deischen@freebsd.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Aug 2003 05:54:03 -0000 On Tue, 5 Aug 2003, David Schultz wrote: > On Tue, Aug 05, 2003, Roderick van Domburg wrote: > > There's this Linux kernel patch that allows for timeslice tuning. It's > > got the following rules of the thumb: > > > > * The optimal setting is your CPU's speed in MHz's / 2 > > * ...but there is no point in going above 1000 Hz > > * ...and be sure to use multiples of 100 Hz > > > > I am everything but an expert at scheduling, but somehow this makes > > sense: i.e. one jiffy for the scheduler and one jiffy for the process. > > > > Does all of this make any sense or is it just a load of hooey? > > There might be some rationale behind that suggestion, but my first > guess would be that someone pulled those numbers out of a hat. In > general, doing a context switch has negative cache effects, in > addition to the overhead that you pay up front. For optimum > throughput, you want to set HZ to the smallest number that still > gives acceptable resolution. 100 Hz works just fine for > interactive jobs; humans can't tell the difference.[1] For many > real-time applications, a higher value is needed. > > > [1] In terms of overhead, I think 100 Hz is well into the noise > these days, so bumping that up a little bit would result in > negligible difference. I measured 100 vs. 500 a little while > ago, and couldn't find a realistic benchmark that was negatively > impacted by the higher frequency. I used to run my old Pentium I (200MHz) laptop at 1000Hz without any problems. I ran it this way for years until I retired it a few months ago. I'd support raising our default rate from 100Hz to 1000Hz. -- Dan Eischen