From owner-freebsd-stable@FreeBSD.ORG Sun Dec 19 09:20:33 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BE151065670; Sun, 19 Dec 2010 09:20:33 +0000 (UTC) (envelope-from perryh@pluto.rain.com) Received: from agora.rdrop.com (agora.rdrop.com [IPv6:2607:f678:1010::34]) by mx1.freebsd.org (Postfix) with ESMTP id 5DB918FC20; Sun, 19 Dec 2010 09:20:33 +0000 (UTC) Received: from agora.rdrop.com (66@localhost [127.0.0.1]) by agora.rdrop.com (8.13.1/8.12.7) with ESMTP id oBJ9KWop035829 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Sun, 19 Dec 2010 01:20:32 -0800 (PST) (envelope-from perryh@pluto.rain.com) Received: (from uucp@localhost) by agora.rdrop.com (8.13.1/8.12.9/Submit) with UUCP id oBJ9KWLs035828; Sun, 19 Dec 2010 01:20:32 -0800 (PST) Received: from fbsd61 by pluto.rain.com (4.1/SMI-4.1-pluto-M2060407) id AA14953; Sun, 19 Dec 10 01:12:21 PST Date: Sun, 19 Dec 2010 01:11:52 -0800 From: perryh@pluto.rain.com To: avg@freebsd.org Message-Id: <4d0dcc58.Z6ITxDmhSuMVmGVR%perryh@pluto.rain.com> References: <4cfc72a5.3nAjkv8mdrO/NrKQ%perryh@pluto.rain.com> <4CFD0633.9060509@freebsd.org> <4d089a74.vwMJkPEIddt7PIxy%perryh@pluto.rain.com> <4D08AACB.6060306@freebsd.org> <4d09dd2e.iVncbZ/gHBXX0WdL%perryh@pluto.rain.com> <4D09E0F3.5040302@freebsd.org> In-Reply-To: <4D09E0F3.5040302@freebsd.org> User-Agent: nail 11.25 7/29/05 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-stable@freebsd.org Subject: Tunables (Re: How to debug a double fault? (Re: Could MSGBUF_SIZE be made a loader tunable?)) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Dec 2010 09:20:33 -0000 Andriy Gapon wrote: > on 16/12/2010 11:34 perryh@pluto.rain.com said the following: > > Andriy Gapon wrote: > >> BTW, are you sure that you correctly placed initialization of > >> msgbufsize ? > > > > I am not at all sure of that ... > > > > Apart from the name, msgbufsize is set up in exactly the same > > way and place -- in init_param1() -- as maxswzone and maxbcache. > > Perhaps that is not early enough ... > > I don't see any connection between msgbufsize and maxswzone, > so I also don't know if that place is early enough. The only "connection" is that maxswzone and maxbcache seemed to be loader tunables that cannot be changed (via sysctl) while the system is running -- the same usage paradigm I have in mind for msgbufsize. I've since found the description of i386 startup in the Architecture Handbook, and based on that -- and the code in locore.s and machdep.c -- it certainly _seems_ as if init_param1() should be early enough: Practically the first thing that locore.s does after establishing virtual addressing is to call init386(), and init386() calls init_param1() long before it either accesses msgbufsize directly or calls getmemsize() (which uses msgbufsize to allocate space for the kernel message buffer). > Just try to initialize the variable where it's defined and use > TUNABLE_LONG. Is there any documentation on how to use the TUNABLE_* macros, or on when to use, say, TUNABLE_LONG vs TUNABLE_LONG_FETCH? I found nothing with their definitions in sys/kernel.h, nor in any of the base-system manpages, nor in /usr/share/doc/...