From owner-freebsd-hackers Fri Aug 31 12:52:56 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by hub.freebsd.org (Postfix) with ESMTP id D898037B405; Fri, 31 Aug 2001 12:52:47 -0700 (PDT) Received: from bde.zeta.org.au (bde.zeta.org.au [203.2.228.102]) by mailman.zeta.org.au (8.9.3/8.8.7) with ESMTP id FAA07363; Sat, 1 Sep 2001 05:52:39 +1000 Date: Sat, 1 Sep 2001 05:52:26 +1000 (EST) From: Bruce Evans X-X-Sender: To: Cc: , , , , , , , , , , , Subject: Re: Clock speedup on 4.X FreeBSD SMP and serverworks chipset In-Reply-To: <200108311915.VAA34938@midten.fast.no> Message-ID: <20010901053233.W5355-100000@besplex.bde.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Fri, 31 Aug 2001 Tor.Egge@fast.no wrote: > For RELENG_4, which uses Xintr0, this problem is reduced by adding the > clkintr_pending variable (cf. revision 1.134 of clock.c and revision > 1.38 of apic_vector.s) > > Looking more at the code, I now see that clkintr_pending is never set > in -current due to Xintr0 not being used (Xfastintr0 is now used). > Using a fast interrupt for the clock interrupt gives some of the same > reduction of the race window size as the use of clkintr_pending. I remember this a bit better after reading my log message for rev.1.134 of clock.c :-). At the time, the clock interrupt handler was not fast. However, it could be delayed for a while by a fast interrupt handler (it still can). Since it is delayed, it can't set clkintr_pending and we have to rely on the irr overflow test working for longer. Rev.1.134 only claims to work for the non-SMP case. The irr test apparently never worked for SMP. Otherwise, it might be preferable to use the irr overflow check instead of or as a backup to clkintr_pending, but it can't be, since the irr bit is cleared when the irq is acked. This behaviour also gives races for SMP: the irr bit may become invalid while you're looking it when another CPU acks the irq. Making the clock interrupt handler fast doesn't significantly change the problems as far as I can see. Bruce To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message