Date: Tue, 10 Feb 1998 18:21:24 +0100 From: Eivind Eklund <eivind@yes.no> To: Steve Passe <smp@csn.net> Cc: Eivind Eklund <eivind@yes.no>, current@FreeBSD.ORG Subject: Re: Minor test from somebody with SMP needed Message-ID: <19980210182124.35246@follo.net> In-Reply-To: <199802101711.KAA23233@Ilsa.StevesCafe.com>; from Steve Passe on Tue, Feb 10, 1998 at 10:11:51AM -0700 References: <19980210174001.25447@follo.net> <199802101711.KAA23233@Ilsa.StevesCafe.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <sys/kernel.h>
#include <sys/sysctl.h>
@@ -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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980210182124.35246>
