From owner-freebsd-bugs@FreeBSD.ORG Thu Jun 14 07:30:10 2007 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3FB9A16A400 for ; Thu, 14 Jun 2007 07:30:10 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [69.147.83.40]) by mx1.freebsd.org (Postfix) with ESMTP id CEA5713C448 for ; Thu, 14 Jun 2007 07:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id l5E7U9A4062820 for ; Thu, 14 Jun 2007 07:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id l5E7U9Er062819; Thu, 14 Jun 2007 07:30:09 GMT (envelope-from gnats) Date: Thu, 14 Jun 2007 07:30:09 GMT Message-Id: <200706140730.l5E7U9Er062819@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Bruce Evans Cc: 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 Reply-To: Bruce Evans List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Jun 2007 07:30:10 -0000 The following reply was made to PR misc/113670; it has been noted by GNATS. From: Bruce Evans To: Ighighi Cc: freebsd-gnats-submit@FreeBSD.org, freebsd-bugs@FreeBSD.org Subject: Re: kern/113670: wrong advertising of default value for HZ in sys/conf/NOTES Date: Thu, 14 Jun 2007 17:24:52 +1000 (EST) 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