From owner-cvs-all@FreeBSD.ORG Wed Aug 30 18:38:30 2006 Return-Path: X-Original-To: cvs-all@freebsd.org Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6DCE216A5B9; Wed, 30 Aug 2006 18:38:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id B1D5A43D6B; Wed, 30 Aug 2006 18:38:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id k7UIcOvm017437; Wed, 30 Aug 2006 14:38:26 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Bruce Evans Date: Wed, 30 Aug 2006 13:20:32 -0400 User-Agent: KMail/1.9.1 References: <200608292036.k7TKaXBp044347@repoman.freebsd.org> <20060830192747.B86395@delplex.bde.org> In-Reply-To: <20060830192747.B86395@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200608301320.33720.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 30 Aug 2006 14:38:26 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/1772/Wed Aug 30 12:01:16 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: cvs-src@freebsd.org, src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/sys sx.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 18:38:30 -0000 On Wednesday 30 August 2006 05:37, Bruce Evans wrote: > On Tue, 29 Aug 2006, John Baldwin wrote: > > > jhb 2006-08-29 20:36:33 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/sys sx.h > > Log: > > The _sx_assert() prototype should exist if either of INVARIANTS or > > INVARIANT_SUPPORT is defined so you can build a kernel with > > INVARIANT_SUPPORT, but build a module with just INVARIANTS on. > > No it shouldn't. INVARIANT_SUPPORT is a documented prerequisite for > INVARIANTS. So is the resulting requirements for using INVARIANTS to > create non-modular "modules": From /sys/conf/NOTES: > > # The INVARIANT_SUPPORT option makes us compile in support for > # verifying some of the internal structures. It is a prerequisite for > ^^^^^^^^^^^^^^^^^^^^^^^^ > # 'INVARIANTS', as enabling 'INVARIANTS' will make these functions be > ^^^^^^^^^^^^ > # called. The intent is that you can set 'INVARIANTS' for single > # source files (by changing the source file or specifying it on the > # command line) if you have 'INVARIANT_SUPPORT' enabled. Also, if you > ^^^^^^^^^^^^ > # wish to build a kernel module with 'INVARIANTS', then adding > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > # 'INVARIANT_SUPPORT' to your kernel will provide all the necessary > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > # infrastructure without the added overhead. > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > However, INVARIANTS is a fairly bogus option. Last time I looked > (long ago) it only controlled a small amount of kernel bloat, and there > are probably many other functions that are defined unconditionally else > modules with INVARIANTS would be more broken. Err, the text in NOTES is probably wrong then. The idea is that INVARIANTS enables various assertions. Similar to how NDEBUG turns off assert() (but inverted). The purpose of INVARIANT_SUPPORT is to provide any needed assertion-supporting code (such as _foo_assert()) macros in the kernel. Thus, if I want to run any code that uses INVARIANTs, I need to have a kernel built with INVARIANT_SUPPORT. However, I might build only selected portions of the kernel with INVARIANTS. For example, I might build none of the kernel with INVARIANTS, but only a kernel module for a device driver being developed or a test kernel module (like my crash.c and crash2.c.). -- John Baldwin