From owner-freebsd-current Tue Oct 31 21: 7: 4 2000 Delivered-To: freebsd-current@freebsd.org Received: from cs.utep.edu (mail.cs.utep.edu [129.108.5.3]) by hub.freebsd.org (Postfix) with ESMTP id DEE3637B479; Tue, 31 Oct 2000 21:06:34 -0800 (PST) Received: from gecko (gecko [129.108.5.51]) by cs.utep.edu (8.10.1/8.10.1) with ESMTP id eA156Di03929; Tue, 31 Oct 2000 22:06:14 -0700 (MST) Date: Tue, 31 Oct 2000 22:06:14 -0700 (MST) From: X-Sender: janb@gecko To: Boris Popov Cc: Eivind Eklund , current@FreeBSD.ORG Subject: Re: INVARIANTS and -current In-Reply-To: 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 Could someone give a quick explanation what INVARIANTS does? JAn On Wed, 1 Nov 2000, Boris Popov wrote: > 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 > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message