From owner-freebsd-current Tue Oct 31 20:45:43 2000 Delivered-To: freebsd-current@freebsd.org Received: from relay.butya.kz (butya-gw.butya.kz [212.154.129.94]) by hub.freebsd.org (Postfix) with ESMTP id 0BB0037B4CF; Tue, 31 Oct 2000 20:45:39 -0800 (PST) Received: by relay.butya.kz (Postfix, from userid 1000) id 1588328C89; Wed, 1 Nov 2000 10:45:35 +0600 (ALMT) Received: from localhost (localhost [127.0.0.1]) by relay.butya.kz (Postfix) with ESMTP id 001B628C74; Wed, 1 Nov 2000 10:45:34 +0600 (ALMT) Date: Wed, 1 Nov 2000 10:45:34 +0600 (ALMT) From: Boris Popov To: Eivind Eklund Cc: current@FreeBSD.org Subject: Re: INVARIANTS and -current In-Reply-To: <20001031175851.A75483@warning.follo.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, 31 Oct 2000, Eivind Eklund wrote: > I want to enable INVARIANTS by default in -current. This result in some > slowdown, but it also makes it more likely that we'll find bugs quickly. > People that want to run -current should know enough to disable it if it is > in the way, anyway. > > Well-reasoned objections welcome. Yes, running kernel with INVARIANTS is a very good idea (in fact, my -current setup runs it for over a year now). But this option will produce inconsistent data structures in the kernel and modules (just like with SMP case). While it is recommended to avoid modules on -current - I'm don't agree with this statement because many people use them. In any way, fix for this is very simple (it assumes that INVARIANTS defined somewhere in the make.conf or sys.mk): Index: conf/kmod.mk =================================================================== RCS file: /home/ncvs/src/sys/conf/kmod.mk,v retrieving revision 1.83 diff -u -r1.83 kmod.mk --- conf/kmod.mk 2000/09/05 22:37:46 1.83 +++ conf/kmod.mk 2000/09/30 05:55:55 @@ -90,6 +90,10 @@ CFLAGS+= ${COPTS} -D_KERNEL ${CWARNFLAGS} CFLAGS+= -DKLD_MODULE +.if defined(INVARIANTS) +CFLAGS+= -DINVARIANTS +.endif + # Don't use any standard or source-relative include directories. # Since -nostdinc will annull any previous -I paths, we repeat all # such paths after -nostdinc. It doesn't seem to be possible to -- Boris Popov http://www.butya.kz/~bp/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message