From owner-freebsd-smp Fri Aug 31 10:35:31 2001 Delivered-To: freebsd-smp@freebsd.org Received: from InterJet.elischer.org (c421509-a.pinol1.sfba.home.com [24.7.86.9]) by hub.freebsd.org (Postfix) with ESMTP id 0426837B407; Fri, 31 Aug 2001 10:35:23 -0700 (PDT) Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id KAA96839; Fri, 31 Aug 2001 10:50:30 -0700 (PDT) Date: Fri, 31 Aug 2001 10:50:28 -0700 (PDT) From: Julian Elischer To: Tor.Egge@fast.no Cc: mb@imp.ch, bde@zeta.org.au, bkarp@icsi.berkeley.edu, kpielorz@tdx.co.uk, sthaug@nethelp.no, atrn@zeta.org.au, roberto@eurocontrol.fr, drussell@saturn-tech.com, phk@FreeBSD.ORG, Patrick.Guelat@imp.ch, freebsd-hackers@FreeBSD.ORG, freebsd-smp@FreeBSD.ORG Subject: Re: Clock speedup on 4.X FreeBSD SMP and serverworks chipset In-Reply-To: <200108310148.DAA80823@midten.fast.no> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-smp@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org tor, will you commit this? On Fri, 31 Aug 2001 Tor.Egge@fast.no wrote: > > I wrote: > > > The problem here is that CPU#1 fails to hold clock_lock while setting > > clkintr_pending, causing i8254_offset to be stepped twice, first due > > to clkintr_pending, then due to i8254_lastcount being larger than count. > > With this patch applied to RELENG_4, the clock speedup seems to disappear. > > > --- apic_vector.s.old Fri Mar 2 13:47:31 2001 > +++ apic_vector.s Fri Aug 31 01:07:53 2001 > @@ -707,7 +707,12 @@ > FAST_INTR(21,fastintr21) > FAST_INTR(22,fastintr22) > FAST_INTR(23,fastintr23) > -#define CLKINTR_PENDING movl $1,CNAME(clkintr_pending) > +#define CLKINTR_PENDING pushl $clock_lock; \ > + call s_lock; \ > + movl $1,CNAME(clkintr_pending); \ > + call s_unlock; \ > + addl $4, %esp > + > INTR(0,intr0, CLKINTR_PENDING) > INTR(1,intr1,) > INTR(2,intr2,) > > > The corresponding patch for -current is > > Index: apic_vector.s > =================================================================== > RCS file: /home/ncvs/src/sys/i386/isa/apic_vector.s,v > retrieving revision 1.71 > diff -u -r1.71 apic_vector.s > --- apic_vector.s 27 Apr 2001 19:28:21 -0000 1.71 > +++ apic_vector.s 31 Aug 2001 01:35:05 -0000 > @@ -7,6 +7,8 @@ > #include > #include > > +#include > + > #include "i386/isa/intr_machdep.h" > > /* convert an absolute IRQ# into a bitmask */ > @@ -384,7 +425,11 @@ > FAST_INTR(29,fastintr29) > FAST_INTR(30,fastintr30) > FAST_INTR(31,fastintr31) > -#define CLKINTR_PENDING movl $1,CNAME(clkintr_pending) > +#define CLKINTR_PENDING MTX_LOCK_SPIN(clock_lock, 0); \ > + movl $1,CNAME(clkintr_pending); \ > + MTX_UNLOCK_SPIN(clock_lock) > + > + > /* Threaded interrupts */ > INTR(0,intr0, CLKINTR_PENDING) > INTR(1,intr1,) > > > - Tor Egge > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-smp" in the body of the message > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message