From owner-freebsd-current@FreeBSD.ORG Fri Apr 13 04:54:14 2007 Return-Path: X-Original-To: freebsd-current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5003C16A401 for ; Fri, 13 Apr 2007 04:54:14 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from qsrv02ps.mx.bigpond.com (qsrv02ps.mx.bigpond.com [144.140.83.182]) by mx1.freebsd.org (Postfix) with ESMTP id DF0D213C44C for ; Fri, 13 Apr 2007 04:54:13 +0000 (UTC) (envelope-from andrew@areilly.bpa.nu) Received: from oaamta08ps.mx.bigpond.com ([144.132.228.157]) by omta04ps.mx.bigpond.com with ESMTP id <20070413031512.FXMA15631.omta04ps.mx.bigpond.com@oaamta08ps.mx.bigpond.com> for ; Fri, 13 Apr 2007 03:15:12 +0000 Received: from areilly.bpa.nu ([144.132.228.157]) by oaamta08ps.mx.bigpond.com with ESMTP id <20070413031512.LDVN8812.oaamta08ps.mx.bigpond.com@areilly.bpa.nu> for ; Fri, 13 Apr 2007 03:15:12 +0000 Received: (qmail 28952 invoked by uid 501); 13 Apr 2007 03:14:22 -0000 Date: Fri, 13 Apr 2007 13:14:22 +1000 From: Andrew Reilly To: Dag-Erling Sm?rgrav Message-ID: <20070413031422.GA27743@duncan.reilly.home> References: <20070406025700.GB98545@garage.freebsd.pl> <86k5wo55s0.fsf@dwp.des.no> <20070407203411.GJ8831@cicely12.cicely.de> <86wt0n3mxv.fsf@dwp.des.no> <20070411214911.GA38351@VARK.MIT.EDU> <20070412073605.GB834@turion.vk2pj.dyndns.org> <86ps6aht1i.fsf@dwp.des.no> <20070412160603.GB92079@keira.kiwi-computer.com> <20070412185159.GB95302@nowhere> <86slb5e33a.fsf@dwp.des.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86slb5e33a.fsf@dwp.des.no> User-Agent: Mutt/1.4.2.2i X-Mailman-Approved-At: Fri, 13 Apr 2007 11:28:27 +0000 Cc: freebsd-fs@FreeBSD.ORG, Craig Boston , "Rick C. Petty" , freebsd-current@FreeBSD.ORG Subject: Re: ZFS committed to the FreeBSD base. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Apr 2007 04:54:14 -0000 On Thu, Apr 12, 2007 at 10:43:05PM +0200, Dag-Erling Sm?rgrav wrote: > Craig Boston writes: > > For something this low level my opinion is it's better to stay with > > compile time options. After all, in the above example, cmpxchg8 is a > > single machine instruction. How much overhead does it add to retrieve a > > variable from memory and check it, then jump to the correct place? > > Enough that it outweighs the benefit of using that instruction in the > > first place? > > I don't think it matters. Contrary to popular belief, atomic > operations are *expensive*. In the best case, on a UP machine, they > stall the pipeline. In the worst case, on an SMP machine, they stall > the entire memory bus. Apart from the fact that you are correct, how long is the instruction encoding of cmpxchg8? Perhaps it could be patched in at runtime, in place of the call to the emultaion, the way of on-the-fly linking in shared libraries and some floating point emulation/inline-ers? -- Andrew