From owner-freebsd-alpha Tue Sep 12 14:40: 5 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from mail.du.gtn.com (mail.du.gtn.com [194.77.9.57]) by hub.freebsd.org (Postfix) with ESMTP id 789FF37B42C for ; Tue, 12 Sep 2000 14:40:00 -0700 (PDT) Received: from mail.cicely.de (cicely.de [194.231.9.142]) by mail.du.gtn.com (8.11.0.Beta3/8.11.0.Beta3) with ESMTP id e8CLdq102331 (using TLSv1/SSLv3 with cipher EDH-RSA-DES-CBC3-SHA (168 bits) verified OK); Tue, 12 Sep 2000 23:39:54 +0200 (MET DST) Received: from cicely5.cicely.de (cicely5.cicely.de [fec0::104:200:92ff:fe9b:20e7]) by mail.cicely.de (8.11.0.Beta1/8.11.0.Beta1) with ESMTP id e8CLdqp70945; Tue, 12 Sep 2000 23:39:53 +0200 (CEST) Received: (from ticso@localhost) by cicely5.cicely.de (8.11.0/8.9.2) id e8CLdqs56576; Tue, 12 Sep 2000 23:39:52 +0200 (CEST) (envelope-from ticso) Date: Tue, 12 Sep 2000 23:39:51 +0200 From: Bernd Walter To: Doug Rabson Cc: John Baldwin , alpha@FreeBSD.ORG Subject: Re: Mutex's aren't recursing Message-ID: <20000912233951.A56554@cicely5.cicely.de> References: <200009120028.RAA71076@pike.osd.bsdi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: ; from dfr@nlsystems.com on Tue, Sep 12, 2000 at 09:32:23PM +0100 Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Tue, Sep 12, 2000 at 09:32:23PM +0100, Doug Rabson wrote: > I sent you some mail yesterday about this. I got the constraints wrong for > the inline assembler in atomic_cmpset. I disassembled some of the code in > interrupt.c which is trying to enter the mutex. You can clearly see that > it is misusing t1 as both an input and output to the inline. > > 0xfffffc00005542c4 : lda t1,8(zero) > 0xfffffc00005542c8 : ldq t0,64(t7) > 0xfffffc00005542cc : ldq_l t1,0(s1) > 0xfffffc00005542d0 : cmpeq t1,t1,t2 > 0xfffffc00005542d4 : beq t2,0xfffffc00005542e4 > 0xfffffc00005542d8 : mov t0,t1 > 0xfffffc00005542dc : stq_c t1,0(s1) > > I'm just about to start testing this patch which should fix the problem > and also provides efficent forms for > atomic_{add,subtract,set,clear}_{32,64}. I also fixed the interrupt > problems with the spin locks (I think). Your patch does the following on a PC164 to me: 1. The mutex change will hang my system every second boot during PCI device printings. 2. Both changes panic the system on boot: [...] da12: Fixed Direct Access SCSI-2 device da12: 5.000MB/s transfers (5.000MHz, offset 7) da12: 206MB (422912 512 byte sectors: 64H 32S/T 206C) da14 at sym2 bus 0 target 3 lun 0 da14: Fixed Direct Access SCSI-CCS device da14: 3.300MB/s transfers da14: 170MB (349770 512 byte sectors: 64H 32S/T 170C) Mounting root from ufs:/dev/da0a fatal kernel trap: trap entry = 0x2 (memory management fault) a0 = 0x0 a1 = 0x1 a2 = 0x0 pc = 0xfffffc0000517458 ra = 0xfffffc0000518fbc curproc = 0xfffffe0008e02720 pid = 7, comm = init Stopped at mtx_exit_hard+0x118: ldq t1,0(s1) <0x0> db> trace mtx_exit_hard() at mtx_exit_hard+0x118 child_return() at child_return+0x9c exception_return() at exception_return -- B.Walter COSMO-Project http://www.cosmo-project.de ticso@cicely.de Usergroup info@cosmo-project.de To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message