From owner-freebsd-stable Sun Nov 11 2:42:50 2001 Delivered-To: freebsd-stable@freebsd.org Received: from digitaldaemon.com (digitaldaemon.com [63.105.9.34]) by hub.freebsd.org (Postfix) with SMTP id 1D52737B417 for ; Sun, 11 Nov 2001 02:42:45 -0800 (PST) Received: (qmail 72129 invoked from network); 11 Nov 2001 10:42:17 -0000 Received: from 213-84-202-101.adsl.xs4all.nl (HELO jak.nl) (213.84.202.101) by jak.nl with SMTP; 11 Nov 2001 10:42:17 -0000 Message-ID: <3BEE56A2.2000305@jak.nl> Date: Sun, 11 Nov 2001 11:44:50 +0100 From: Arjan Knepper Organization: JAK++ Software Development B.V. User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: Tor.Egge@cvsup.no.freebsd.org Cc: freebsd-stable@FreeBSD.ORG Subject: Re: FBSD4.4-STABLE SMP broken! References: <20011110172005.J999-100000@klima.physik.uni-mainz.de> <20011111003641B.tegge@cvsup.no.freebsd.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dear Tor, Do you think this is related to the problems below with a dual PIII-933 Mhz Dell PowerEdge 2550 (serverworks chipset)? panic: rslock: cpu: 1, addr:0xc0307228, lock: 0x01000001 mp_lock = 01000002; cpuid =1; lapic.id = 00000000 boot() called on cpu#1 Thanks Arjan Tor.Egge@cvsup.no.freebsd.org wrote: >>I did a cvsupdate today, the target machine was running >>stable for the last four days. >> >>After the update and make world today, the system run a few minutes and then >>get stuck ... no keyboard input, nothing, no network response. >> > >Sleeping while holding a simplelock can be fatal on an SMP machine. >If the other CPU tries to obtain the simplelock then you get a hang. >If the same CPU tries to obtain the simplelock then you get a panic. > >One example is vinvalbuf() holding the vnode interlock while calling >vm_object_page_remove() (which might block), cf. PR 26224. > >For 4.4-STABLE, it might make sense to just define some simplelock >operations to nops also under SMP. All relevant code is already >serialized by mp_lock and further lock pushdown is unlikely to occur >on that branch. The only effect of these simplelock operations under >4.4-STABLE SMP is a hang or panic when the locking protocol is >violated. > >The enclosed patch will break 3rd party device drivers that use fast >interrupts and simple_lock() to serialize access to shared resources. >I don't know about any such device drivers. > >You'll need to add > > options SIMPLELOCK_NULL > >to the relevant kernel config file and recompile the kernel for the >patch to have any effect. > >- Tor Egge > > >------------------------------------------------------------------------ > >Index: sys/conf/options >=================================================================== >RCS file: /home/ncvs/src/sys/conf/options,v >retrieving revision 1.191.2.37 >diff -u -r1.191.2.37 options >--- sys/conf/options 3 Nov 2001 01:41:07 -0000 1.191.2.37 >+++ sys/conf/options 10 Nov 2001 23:29:19 -0000 >@@ -361,7 +363,8 @@ > INVARIANT_SUPPORT opt_global.h > INVARIANTS opt_global.h > SIMPLELOCK_DEBUG opt_global.h >+SIMPLELOCK_NULL opt_global.h > VFS_BIO_DEBUG opt_global.h > > # These are VM related options > VM_KMEM_SIZE opt_vm.h >Index: sys/i386/include/lock.h >=================================================================== >RCS file: /home/ncvs/src/sys/i386/include/Attic/lock.h,v >retrieving revision 1.11.2.2 >diff -u -r1.11.2.2 lock.h >--- sys/i386/include/lock.h 30 Sep 2000 02:49:34 -0000 1.11.2.2 >+++ sys/i386/include/lock.h 10 Nov 2001 23:29:19 -0000 >@@ -170,6 +170,18 @@ > extern struct simplelock mcount_lock; > > #if !defined(SIMPLELOCK_DEBUG) && MAXCPU > 1 >+ >+#ifdef SIMPLELOCK_NULL >+ >+/* On SMP systems, mp_lock is used for the serialization */ >+ >+#define NULL_SIMPLELOCKS >+#define simple_lock_init(alp) >+#define simple_lock(alp) >+#define simple_lock_try(alp) (1) /* always succeeds */ >+#define simple_unlock(alp) >+ >+#else > /* > * This set of defines turns on the real functions in i386/isa/apic_ipl.s. > */ >@@ -177,6 +189,8 @@ > #define simple_lock(alp) s_lock(alp) > #define simple_lock_try(alp) s_lock_try(alp) > #define simple_unlock(alp) s_unlock(alp) >+ >+#endif > > #endif /* !SIMPLELOCK_DEBUG && MAXCPU > 1 */ > > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message