From owner-p4-projects@FreeBSD.ORG Thu Jul 29 21:07:00 2004 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 1E6D016A4D1; Thu, 29 Jul 2004 21:07:00 +0000 (GMT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CDCC816A4CF for ; Thu, 29 Jul 2004 21:06:59 +0000 (GMT) Received: from mail2.speakeasy.net (mail2.speakeasy.net [216.254.0.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9A9A43D5D for ; Thu, 29 Jul 2004 21:06:59 +0000 (GMT) (envelope-from jhb@FreeBSD.org) Received: (qmail 8164 invoked from network); 29 Jul 2004 21:06:59 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 29 Jul 2004 21:06:59 -0000 Received: from 10.50.40.208 (gw1.twc.weather.com [216.133.140.1]) (authenticated bits=0) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i6TL6rDI090569; Thu, 29 Jul 2004 17:06:55 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: Julian Elischer Date: Thu, 29 Jul 2004 17:05:27 -0400 User-Agent: KMail/1.6 References: <200407292035.i6TKZqh2054795@repoman.freebsd.org> <4109602F.9080108@elischer.org> In-Reply-To: <4109602F.9080108@elischer.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407291705.27004.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: Perforce Change Reviews Subject: Re: PERFORCE change 58484 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Jul 2004 21:07:01 -0000 On Thursday 29 July 2004 04:38 pm, Julian Elischer wrote: > John Baldwin wrote: > >http://perforce.freebsd.org/chv.cgi?CH=58484 > > > >Change 58484 by jhb@jhb_slimer on 2004/07/29 20:35:13 > > > > Try to optimize intr_disable/restore by avoiding cli/sti like the > > plague. > > shouldn't one of these tests be reversed? Nope. If interrupts are enabled then we want to disable them in intr_disable(). If the saved state of interrupts is that they were enabled then we want to re-enable them in intr_restore(). If interrupts are disabled already, then we just leave everything alone. > >Affected files ... > > > >.. //depot/projects/smpng/sys/i386/include/cpufunc.h#28 edit > > > >Differences ... > > > >==== //depot/projects/smpng/sys/i386/include/cpufunc.h#28 (text+ko) ==== > > > >@@ -611,14 +611,16 @@ > > register_t eflags; > > > > eflags = read_eflags(); > >- disable_intr(); > >+ if (eflags & PSL_I) > >+ disable_intr(); > > return (eflags); > > } > > > > static __inline void > > intr_restore(register_t eflags) > > { > >- write_eflags(eflags); > >+ if (eflags & PSL_I) > >+ enable_intr(); > > } > > > > #else /* !(__GNUC__ || __INTEL_COMPILER) */ -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org