From owner-freebsd-current Mon Feb 25 3:48: 2 2002 Delivered-To: freebsd-current@freebsd.org Received: from anchor-post-30.mail.demon.net (anchor-post-30.mail.demon.net [194.217.242.88]) by hub.freebsd.org (Postfix) with ESMTP id 703DC37B400; Mon, 25 Feb 2002 03:47:59 -0800 (PST) Received: from mailgate.nlsystems.com ([62.49.251.130] helo=herring.nlsystems.com) by anchor-post-30.mail.demon.net with esmtp (Exim 3.34 #1) id 16fJbp-0007VK-0U; Mon, 25 Feb 2002 11:47:57 +0000 Received: from herring (herring [10.0.0.2]) by herring.nlsystems.com (8.11.2/8.11.2) with ESMTP id g1PBkg924443; Mon, 25 Feb 2002 11:46:42 GMT (envelope-from dfr@nlsystems.com) Date: Mon, 25 Feb 2002 11:46:42 +0000 (GMT) From: Doug Rabson To: Andrew Gallatin Cc: Matthew Dillon , John Baldwin , Subject: Re: Patch for critical_enter()/critical_exit() & interrupt assembly revamp, please review! In-Reply-To: <15481.36444.52026.935742@grasshopper.cs.duke.edu> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sun, 24 Feb 2002, Andrew Gallatin wrote: > > I'm not fluent in x86 asm, so can you confirm for me what you're > attempting to do here? > > I think you're making critical_enter()/critical_exit() cheaper by not > actually messing with the interrupt hardware when they're called. > Very much like what we do in 4-stable. > > Instead, you set/clear a per-cpu flag (or incr/decr a counter). If an > interrupt comes in when you're inside a critical section, you make > note of it & mask interrupts on that cpu. In critical_exit(), > you run the interrupt handler if there's a pending interrupt, and > unmask interrupts. If there's not a pending interrupt, you just clear > the flag (or devrement a counter). > > Is that basically it? > > If so, I'm wondering if this is even possible on alpha, where we don't > have direct access to the hardware. However, according to the psuedo > code for rti in the Brown book, munging with the saved PSL in > trapframe to set the IPL should work. Hmm.. I think we can tweak the saved PSL and it should be able to mask interrupts in the same way as for x86. This should be quite easy for ia64 too. -- Doug Rabson Mail: dfr@nlsystems.com Phone: +44 20 8348 6160 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message