From owner-freebsd-current@FreeBSD.ORG Thu Apr 12 16:32:46 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 2821416A404 for ; Thu, 12 Apr 2007 16:32:46 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: from kiwi-computer.com (keira.kiwi-computer.com [63.224.10.3]) by mx1.freebsd.org (Postfix) with SMTP id A484E13C457 for ; Thu, 12 Apr 2007 16:32:45 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 93069 invoked by uid 2001); 12 Apr 2007 16:06:03 -0000 Date: Thu, 12 Apr 2007 11:06:03 -0500 From: "Rick C. Petty" To: freebsd-fs@FreeBSD.ORG Message-ID: <20070412160603.GB92079@keira.kiwi-computer.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <86ps6aht1i.fsf@dwp.des.no> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Thu, 12 Apr 2007 17:57:41 +0000 Cc: 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 Reply-To: rick-freebsd@kiwi-computer.com List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2007 16:32:46 -0000 On Thu, Apr 12, 2007 at 10:54:17AM +0200, Dag-Erling Sm?rgrav wrote: > > Our native atomic operations are all defined as either macros or > static inline functions in machine/atomic.h, so we can easily make > this choice at compile time based on a config option. 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)) Otherwise something like ZFS which utilizes this feature a lot could check the MIB variable and set different fn ptr in its device structure, or something along those lines. Of course, that would require compiling the same code twice essentially, but it had the advantage that it would work on non-CX8 systems and that it would be fast on systems with CX8. -- Rick C. Petty