From owner-cvs-src@FreeBSD.ORG Wed Aug 30 20:51:40 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3DE7A16A4DE; Wed, 30 Aug 2006 20:51:40 +0000 (UTC) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (relay0.rambler.ru [81.19.66.187]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1179343D76; Wed, 30 Aug 2006 20:51:32 +0000 (GMT) (envelope-from ru@rambler-co.ru) Received: from relay0.rambler.ru (localhost [127.0.0.1]) by relay0.rambler.ru (Postfix) with ESMTP id DD1FF6172; Thu, 31 Aug 2006 00:51:30 +0400 (MSD) Received: from edoofus.park.rambler.ru (unknown [81.19.65.108]) by relay0.rambler.ru (Postfix) with ESMTP id BAADA60C2; Thu, 31 Aug 2006 00:51:30 +0400 (MSD) Received: (from ru@localhost) by edoofus.park.rambler.ru (8.13.6/8.13.6) id k7UKpttX011580; Thu, 31 Aug 2006 00:51:55 +0400 (MSD) (envelope-from ru) Date: Thu, 31 Aug 2006 00:51:55 +0400 From: Ruslan Ermilov To: John Baldwin Message-ID: <20060830205155.GB11411@rambler-co.ru> References: <200608292036.k7TKaXBp044347@repoman.freebsd.org> <20060830192747.B86395@delplex.bde.org> <200608301320.33720.jhb@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="3uo+9/B/ebqu+fSQ" Content-Disposition: inline In-Reply-To: <200608301320.33720.jhb@freebsd.org> User-Agent: Mutt/1.5.12-2006-07-14 X-Virus-Scanned: No virus found Cc: cvs-src@FreeBSD.org, src-committers@FreeBSD.org, cvs-all@FreeBSD.org, Bruce Evans Subject: Re: cvs commit: src/sys/sys sx.h X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Aug 2006 20:51:40 -0000 --3uo+9/B/ebqu+fSQ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Aug 30, 2006 at 01:20:32PM -0400, John Baldwin wrote: > On Wednesday 30 August 2006 05:37, Bruce Evans wrote: > > On Tue, 29 Aug 2006, John Baldwin wrote: > >=20 > > > 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. > >=20 > > 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: > >=20 > > # 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. > > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > >=20 > > 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. >=20 > Err, the text in NOTES is probably wrong then. The idea is that INVARIAN= TS=20 > enables various assertions. Similar to how NDEBUG turns off assert() (bu= t=20 > inverted). The purpose of INVARIANT_SUPPORT is to provide any needed=20 > assertion-supporting code (such as _foo_assert()) macros in the kernel. = =20 > Thus, if I want to run any code that uses INVARIANTs, I need to have a ke= rnel=20 > built with INVARIANT_SUPPORT. However, I might build only selected porti= ons=20 > of the kernel with INVARIANTS. For example, I might build none of the ke= rnel=20 > with INVARIANTS, but only a kernel module for a device driver being devel= oped=20 > or a test kernel module (like my crash.c and crash2.c.). >=20 I read what you've written precisely as what was quoted from NOTES. I.e., to be able to compile some bit with INVARIANTS, the kernel should have been compiled with INVARIANT_SUPPORT. _sx_asser() is part of that support, not a "user" of invatianted code. If some code that uses sx locks needs to be "invarianted", it can be compiled with only "options INVARIANTS". I fail to see how your commit follows this, however. What you have committed may eventually turn into "if option INVARINANTS is enabled when compiling a kernel, automatically enable the INVARIANT_SUPPORT option" -- when all INVARIANT_SUPPORT ifdefs will be converted to INVARIANT_SUPPORT || INVARIANTS. Cheers, --=20 Ruslan Ermilov ru@FreeBSD.org FreeBSD committer --3uo+9/B/ebqu+fSQ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFE9fprqRfpzJluFF4RAgUFAJ44jEjwJFwzT5yUUGVbIMERctPYwQCfa+nz gQNYiXoPsLJWsbFicS42SIQ= =1Swg -----END PGP SIGNATURE----- --3uo+9/B/ebqu+fSQ--