Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2007 14:59:47 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        freebsd-fs@FreeBSD.ORG, freebsd-current@FreeBSD.ORG
Subject:   Re: ZFS committed to the FreeBSD base.
Message-ID:  <20070412195947.GA96935@keira.kiwi-computer.com>
In-Reply-To: <20070412185159.GB95302@nowhere>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070412195947.GA96935>