From owner-freebsd-current Tue Feb 10 09:21:34 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id JAA03314 for current-outgoing; Tue, 10 Feb 1998 09:21:34 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from ns1.yes.no (ns1.yes.no [195.119.24.10]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id JAA03260 for ; Tue, 10 Feb 1998 09:21:31 -0800 (PST) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [194.198.43.36]) by ns1.yes.no (8.8.7/8.8.7) with ESMTP id RAA07786; Tue, 10 Feb 1998 17:21:25 GMT Received: (from eivind@localhost) by bitbox.follo.net (8.8.6/8.8.6) id SAA18433; Tue, 10 Feb 1998 18:21:24 +0100 (MET) Message-ID: <19980210182124.35246@follo.net> Date: Tue, 10 Feb 1998 18:21:24 +0100 From: Eivind Eklund To: Steve Passe Cc: Eivind Eklund , current@FreeBSD.ORG Subject: Re: Minor test from somebody with SMP needed References: <19980210174001.25447@follo.net> <199802101711.KAA23233@Ilsa.StevesCafe.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.88e In-Reply-To: <199802101711.KAA23233@Ilsa.StevesCafe.com>; from Steve Passe on Tue, Feb 10, 1998 at 10:11:51AM -0700 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Tue, Feb 10, 1998 at 10:11:51AM -0700, Steve Passe wrote: > Hi, > > > Can somebody test if their system seem to work reliably with the below > > patch and > > > > options SIMPLELOCK_DEBUG > > > > in their kernel config file? Alternatively, can somebody that > > understand the issues say if the change is correct? > > > > SIMPLELOCK_DEBUG doesn't work at all with a multiprocessor-system as > > it is; the kernel won't even link, and this breaks LINT. > > These routines can't work with SMP as they substitute for real locks > and an SMP machine would soon go down in flames if it depended on them. > They are a debug mechanism for a single CPU system, and predate the > FreeBSD developmnent effort. OK, what is the right fix, then? I can see three obvious 'fixes' for the time being: 1. Make SIMPLELOCK_DEBUG a no-op if NCPUS > 1 2. Rip out the SIMPLELOCK_DEBUG code (if it is no longer usable, and not likely to become usable) 3. Do the below change (basically an error if compiling anything other than LINT with SIMPLELOCK_DEBUG and SMP) Index: kern_lock.c =================================================================== RCS file: /home/ncvs/src/sys/kern/kern_lock.c,v retrieving revision 1.16 diff -u -r1.16 kern_lock.c --- kern_lock.c 1998/02/06 12:13:23 1.16 +++ kern_lock.c 1998/02/10 17:20:08 @@ -462,7 +462,7 @@ printf(" with %d pending", lkp->lk_waitcount); } -#if defined(SIMPLELOCK_DEBUG) && NCPUS == 1 +#if defined(SIMPLELOCK_DEBUG) && (NCPUS == 1 || defined(COMPILING_LINT)) #include #include @@ -555,4 +555,6 @@ if (curproc) curproc->p_simple_locks--; } +#elif defined(SIMPLELOCK_DEBUG) +#error "SIMPLELOCK_DEBUG is not compatible with SMP!" #endif /* SIMPLELOCK_DEBUG && NCPUS == 1 */ Just help me determine what is right, and I'll do the work. Eivind. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe current" in the body of the message