From owner-freebsd-arch Tue Oct 26 13: 9:56 1999 Delivered-To: freebsd-arch@freebsd.org Received: from ns1.yes.no (ns1.yes.no [195.204.136.10]) by hub.freebsd.org (Postfix) with ESMTP id 1668E14C07 for ; Tue, 26 Oct 1999 13:09:33 -0700 (PDT) (envelope-from eivind@bitbox.follo.net) Received: from bitbox.follo.net (bitbox.follo.net [195.204.143.218]) by ns1.yes.no (8.9.3/8.9.3) with ESMTP id WAA24436 for ; Tue, 26 Oct 1999 22:09:27 +0200 (CEST) Received: (from eivind@localhost) by bitbox.follo.net (8.8.8/8.8.6) id WAA22503 for freebsd-arch@freebsd.org; Tue, 26 Oct 1999 22:09:27 +0200 (MET DST) Received: from ns.mt.sri.com (ns.mt.sri.com [206.127.79.91]) by hub.freebsd.org (Postfix) with ESMTP id 5269914CF5 for ; Tue, 26 Oct 1999 13:08:17 -0700 (PDT) (envelope-from nate@mt.sri.com) Received: from mt.sri.com (rocky.mt.sri.com [206.127.76.100]) by ns.mt.sri.com (8.9.3/8.9.3) with SMTP id OAA17887; Tue, 26 Oct 1999 14:07:40 -0600 (MDT) (envelope-from nate@rocky.mt.sri.com) Received: by mt.sri.com (SMI-8.6/SMI-SVR4) id OAA20106; Tue, 26 Oct 1999 14:07:38 -0600 Date: Tue, 26 Oct 1999 14:07:38 -0600 Message-Id: <199910262007.OAA20106@mt.sri.com> From: Nate Williams MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: Randell Jesup Cc: nate@mt.sri.com (Nate Williams), Terry Lambert , imp@village.org, arch@freebsd.org Subject: Re: Racing interrupts In-Reply-To: References: <199910260105.TAA16714@mt.sri.com> <199910260221.TAA26021@usr06.primenet.com> <199910260356.VAA17204@mt.sri.com> <199910261525.JAA18872@mt.sri.com> X-Mailer: VM 6.34 under 19.16 "Lille" XEmacs Lucid Reply-To: nate@mt.sri.com (Nate Williams) Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >You're missing the point. What happens if I'm in the middle of a ISR > >when the device is popped out? How do I recognize that it's gone, when > >I'm expecting the hardware to respond to some request I've sent it? > >What happens when I'm reading a piece of memory that no longer exists? > > Ok, talking to the technical issues: > > [This assumes there's a high-priority interrupt to notify us of > card removal, and the ISR for the interrupt merely sets a flag. Note, many ISR are *NOT* interruptable (fast interrupts for one), or may be in the middle of some critical section where *all* interrupts are disabled, so notification is never given. > It also > assumes that the hardware doesn't go away before the interrupt occurs, > but may be gone by the time the processor handles the interrupt, and that > all pccard ISR's are at a lower interrupt priority than the hardware-is- > gone int.] See above. The existing FreeBSD code is coded as above (by not allowing fast interrupts on serial cards, causing performance to suck badly), but still there are problems. One, we can't use fast interrupts. Two, the drivers can still be in a critical section when the hardware is removed, and there's nothing you can do. This is the 1% case that there's nothing we can do about. (In reality, it may be .1% or even .001%, but I'll bet is closer to 1% than the rest, and it depends on the particular device driver in question.) > First, if you're reading memory that may not exist, check a > flag (whatever) after a series of associated reads, and use that to > know if the reads may have been garbage or not. No we're in the other 1% case that we can work around bug. In this 1% case, in order to do all these checks, we're effectively killing performance (10-15%) because these checks happen in the portion of the code that directly effects how effecient the driver is. > Have I missed something? Some aspect of Unix device drivers I'm > not familiar with? Nope, but this as already mentioned in the disucssion previously, and my statement was that the cost (10-15% performance hit) wasn't worth the benefit. The cost may be less, and the benefit may be greater, but since I was the one doing the coding, I deemed it an unacceptable tradeoff. Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message