From owner-freebsd-arch Wed May 24 19:31:31 2000 Delivered-To: freebsd-arch@freebsd.org Received: from urban.iinet.net.au (urban.iinet.net.au [203.59.24.231]) by hub.freebsd.org (Postfix) with ESMTP id 3DA3D37BCD3 for ; Wed, 24 May 2000 19:31:27 -0700 (PDT) (envelope-from julian@elischer.org) Received: from popserver-02.iinet.net.au (popserver-02.iinet.net.au [203.59.24.148]) by urban.iinet.net.au (8.8.7/8.8.7) with ESMTP id KAA12597; Thu, 25 May 2000 10:31:20 +0800 Received: from jules.elischer.org (reggae-05-120.nv.iinet.net.au [203.59.72.120]) by popserver-02.iinet.net.au (8.9.3/8.9.3) with SMTP id KAA14899; Thu, 25 May 2000 10:31:11 +0800 Message-ID: <392C901D.31DFF4F5@elischer.org> Date: Wed, 24 May 2000 19:29:49 -0700 From: Julian Elischer X-Mailer: Mozilla 3.04Gold (X11; I; FreeBSD 5.0-CURRENT i386) MIME-Version: 1.0 To: Matthew Dillon Cc: Chuck Paterson , Terry Lambert , arch@FreeBSD.ORG Subject: Re: Preemptive kernel on older X86 hardware References: <200005250205.UAA16126@berserker.bsdi.com> <200005250208.TAA78220@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: > > We've had very good luck encapsulating our MP lock code in real > honest-to-god subroutines rather then trying to make them inline > macros. > > On intel anyway, subroutine calls are *cheap*, especially compared > to the overhead of a locked instruction or even an L1 cache miss. > > It's a no-brainer. One paper I read recently (can't remember which) used the method of making all locks calls to very generic (slow) code to start with, and as each lock is run, it replaces the calling code with a call to the appropriate 'quick' call, depending on teh cpu type and whether there si more than one of them. In the UP case, it replaces them with very simple locks or NOPS depending on the type of lock etc. The kernel speeds up as it gradually replaces all the locks. (In fact not so gradual, as >90% of them were replace by the end of booting). Doesn't work for romable code, though you could even do that if you used a redirection table :-) > > -Matt > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message -- __--_|\ Julian Elischer / \ julian@elischer.org ( OZ ) World tour 2000 ---> X_.---._/ presently in: Perth v To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message