From owner-freebsd-alpha Wed Sep 13 13:24:46 2000 Delivered-To: freebsd-alpha@freebsd.org Received: from finch-post-10.mail.demon.net (finch-post-10.mail.demon.net [194.217.242.38]) by hub.freebsd.org (Postfix) with ESMTP id 0305637B422 for ; Wed, 13 Sep 2000 13:24:42 -0700 (PDT) Received: from nlsys.demon.co.uk ([158.152.125.33] helo=herring.nlsystems.com) by finch-post-10.mail.demon.net with esmtp (Exim 2.12 #1) id 13ZJ5D-000N61-0A; Wed, 13 Sep 2000 20:24:40 +0000 Received: from salmon.nlsystems.com (salmon.nlsystems.com [10.0.0.3]) by herring.nlsystems.com (8.9.3/8.8.8) with ESMTP id VAA14508; Wed, 13 Sep 2000 21:26:02 +0100 (BST) (envelope-from dfr@nlsystems.com) Date: Wed, 13 Sep 2000 21:24:58 +0100 (BST) From: Doug Rabson To: John Baldwin Cc: alpha@FreeBSD.ORG Subject: Re: cvs commit: src/sys/alpha/alpha trap.c In-Reply-To: <200009131925.MAA44113@pike.osd.bsdi.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-alpha@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On Wed, 13 Sep 2000, John Baldwin wrote: > Doug Rabson wrote: > > On Tue, 12 Sep 2000, John Baldwin wrote: > > > > > Doug Rabson wrote: > > > > On Tue, 12 Sep 2000, Doug Rabson wrote: > > > > > > > > > dfr 2000/09/12 15:47:10 PDT > > > > > > > > > > Modified files: > > > > > sys/alpha/alpha trap.c > > > > > Log: > > > > > Merge changes from the i386 port to allow userret() to be called both > > > > > with and without holding the Giant mutex. > > > > > > > > With this change, my UP test box boots and appears happy. We will see if > > > > it manages to complete its 'make world'. > > > > > > Can you turn on the Giant enter and exit's in interrupt() now? > > > > I have done this already, mainly to increase the pressure on Giant. I > > still think that its not the right thing to do, even for SMP > > machines. Also, there is clearly a race for recursing a mutex if it can be > > recursed from an irq context since the "m->mtx_recurse++" statement could > > be interrupted. > > We should make it an atomic_add_int() then to work around that for the > time being. I agree it is probably not the right thing to do at the > moment. Once I get ithreads working, it probably won't be needed for > device interrupts anymore, which will help some. If we can bounce the clock > interrupt to a thread that will help as well. For device interrupts, the ithread code will handle taking Giant as appropriate for non-MP-safe drivers. For clock, we need to aim at an MP-safe hardclock with softclock handled by the SWI thread. That should remove all need to take non-spin mutexes in interrupt(). > > Also, I should make a note about the ithreads patch. It tries to use > device_get_nameunit() when adding interrupt handlers so that ithreads can > have useful names such as on the x86 that include the names of the devices > that use that ithread. However, it turns out that during my testing > dev isn't initialized yet, so that device_get_nameunit() ends up dereferencing > NULL pointers. *sigh* In the cia pci code and the isa code I have hacked > around this by just using "pci" and "isa" for the names instead. However, > these hacks are only in those bus drivers atm because I don't plan to have > them in the final patch, so if you are going to try out the ithreads stuff, > you will have to modify your pcibus driver to use a similar hack to that > of cia.c. That sounds odd. The device_get_nameunit() should work the same for both x86 and alpha. I'll investigate that and see if I can come up with something cleaner. -- Doug Rabson Mail: dfr@nlsystems.com Nonlinear Systems Ltd. Phone: +44 20 8348 3944 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-alpha" in the body of the message