From owner-freebsd-current@FreeBSD.ORG Thu Apr 12 19:59:48 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 B1F2716A402 for ; Thu, 12 Apr 2007 19:59:48 +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 38C4913C457 for ; Thu, 12 Apr 2007 19:59:48 +0000 (UTC) (envelope-from rick@kiwi-computer.com) Received: (qmail 99833 invoked by uid 2001); 12 Apr 2007 19:59:47 -0000 Date: Thu, 12 Apr 2007 14:59:47 -0500 From: "Rick C. Petty" To: freebsd-fs@FreeBSD.ORG, freebsd-current@FreeBSD.ORG Message-ID: <20070412195947.GA96935@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> <20070412160603.GB92079@keira.kiwi-computer.com> <20070412185159.GB95302@nowhere> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070412185159.GB95302@nowhere> User-Agent: Mutt/1.4.2.1i X-Mailman-Approved-At: Thu, 12 Apr 2007 20:58:52 +0000 Cc: 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 19:59:48 -0000 On Thu, Apr 12, 2007 at 01:51:59PM -0500, Craig Boston wrote: > > 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? That's why I suggested the second method (to change fn pointers in the device struct). > I agree this makes sense for some things, but atomic operations are > supposed to be as fast as possible -- preferably single machine > instructions I can't think of anything short of JIT compiling the kernel > that wouldn't be a high price to pay. The problem is that ZFS would be compiled (by default) to work for many platforms, and thus a majority of systems wouldn't get the nice optimization. That's why I think we should do something along the lines of doing a check for CX8 and changing the pointers in the vfsops and vop_vector static structures, depending upon the availability of this optimization. I guess it really depends upon how much ZFS uses it; I got the sense that it is "often". -- Rick C. Petty