From owner-freebsd-bugs@FreeBSD.ORG Fri Jun 15 08:35:48 2007 Return-Path: X-Original-To: freebsd-bugs@FreeBSD.org Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D4A5B16A469 for ; Fri, 15 Jun 2007 08:35:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx03.syd.optusnet.com.au (fallbackmx03.syd.optusnet.com.au [211.29.133.136]) by mx1.freebsd.org (Postfix) with ESMTP id 6C04213C458 for ; Fri, 15 Jun 2007 08:35:48 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail32.syd.optusnet.com.au (mail32.syd.optusnet.com.au [211.29.132.63]) by fallbackmx03.syd.optusnet.com.au (8.12.11.20060308/8.12.11) with ESMTP id l5E7OtS9006592 for ; Thu, 14 Jun 2007 17:24:55 +1000 Received: from besplex.bde.org (c220-239-235-248.carlnfd3.nsw.optusnet.com.au [220.239.235.248]) by mail32.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id l5E7OqGf010351 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 14 Jun 2007 17:24:52 +1000 Date: Thu, 14 Jun 2007 17:24:52 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Ighighi In-Reply-To: <200706140523.l5E5NHBu004552@www.freebsd.org> Message-ID: <20070614170135.X31675@besplex.bde.org> References: <200706140523.l5E5NHBu004552@www.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-bugs@FreeBSD.org, freebsd-gnats-submit@FreeBSD.org Subject: Re: kern/113670: wrong advertising of default value for HZ in sys/conf/NOTES X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Jun 2007 08:35:48 -0000 On Thu, 14 Jun 2007, Ighighi wrote: >> Description: > The current src/sys/conf/NOTES (v1.1432) states that: > > -8<-------------------------------------- > > # CLOCK OPTIONS > > # The granularity of operation is controlled by the kernel option HZ whose > # default value (100) means a granularity of 10ms (1s/HZ). > > [...] > options HZ=100 NOTES (LINT) is supposed to give a non-default value, so that non-default values get tested. So 100 in the above options directive was a bug when the default was 100 (I used 101 in NOTES then), but is now correct, while the comment that gives the default was correct but is now wrong. Before this, attached to the options directive for DUMMYNET, is a comment that suggests using "optionz HZ=1000", but this is the default. Similarly for DEVICE_POLLING in the MD NOTES. Reasons why HZ shouldn't be set to 1000 are still in the [...] part of the above comment. These reasons still apply, but on fast machines the loss is closer to 0.5% than 5% or 50% so most users don't notice. > -8<-------------------------------------- > > I guess the real value is 10x that quantity for 4 of the "main" platforms, > as defined in src/sys/kern/subr_param.c > > -8<-------------------------------------- > > #ifndef HZ > # if defined(__amd64__) || defined(__i386__) || defined(__ia64__) || defined(__sparc64__) > # define HZ 1000 > # else > # define HZ 100 > # endif > #endif > > -8<-------------------------------------- > > By looking at the CVS log available at: > http://www.FreeBSD.org/cgi/cvsweb.cgi/sys/kern/subr_param.c > it can be seen that it has been that way since 6.0-RELEASE, with a just a few > platforms being added earlier, and with no mention of it in their respective > GENERIC files, thus being the "real thing". > > I just find it a bit misleading when compiling a new kernel and copy/pasting from NOTES. Don't copy/paste values from NOTES. This should give bizarre values. Copy values from GENERIC and adjust them according to comments in NOTES, but beware that NOTES is likely to be out of date and/or not cover all machine dependencies. E.g., strictly, to match the above ifdef, it is a bug for the MI NOTES to have any options for HZ. It just has options that are several years out of date for HZ. More obscure options may be more out of date. Bruce