From owner-freebsd-fs@FreeBSD.ORG Thu Apr 12 20:43:13 2007 Return-Path: X-Original-To: freebsd-fs@FreeBSD.ORG Delivered-To: freebsd-fs@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 82A8216A405; Thu, 12 Apr 2007 20:43:13 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 3D7FF13C4BA; Thu, 12 Apr 2007 20:43:13 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (localhost [127.0.0.1]) by spam.des.no (Postfix) with ESMTP id C90572090; Thu, 12 Apr 2007 22:43:06 +0200 (CEST) X-Spam-Tests: AWL X-Spam-Learn: disabled X-Spam-Score: 0.0/3.0 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on tim.des.no Received: from dwp.des.no (des.no [80.203.243.180]) by smtp.des.no (Postfix) with ESMTP id 4298B2087; Thu, 12 Apr 2007 22:43:06 +0200 (CEST) Received: by dwp.des.no (Postfix, from userid 1001) id 209DC53B2; Thu, 12 Apr 2007 22:43:05 +0200 (CEST) From: des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=) To: Craig Boston 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> Date: Thu, 12 Apr 2007 22:43:05 +0200 In-Reply-To: <20070412185159.GB95302@nowhere> (Craig Boston's message of "Thu, 12 Apr 2007 13:51:59 -0500") Message-ID: <86slb5e33a.fsf@dwp.des.no> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-fs@FreeBSD.ORG, "Rick C. Petty" , freebsd-current@FreeBSD.ORG Subject: Re: ZFS committed to the FreeBSD base. X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2007 20:43:13 -0000 Craig Boston writes: > On Thu, Apr 12, 2007 at 11:06:03AM -0500, Rick C. Petty wrote: > > Is there any way we could make the choice at boot time, by checking for > > presence of the CX8 feature? Either as something like: > > > > extern int feature_cx8; /* or MIB variable */ > > #define CMPXCHG8(a) (feature_cx8 ? { _asm "..." } : emulate_cmpxch8(a)) > 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. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no