Re: ZFS committed to the FreeBSD base.

From: Andrew Reilly <andrew-freebsd_at_areilly.bpc-users.org>
Date: Fri, 13 Apr 2007 13:14:22 +1000
On Thu, Apr 12, 2007 at 10:43:05PM +0200, Dag-Erling Sm?rgrav wrote:
> Craig Boston <craig_at_xfoil.gank.org> 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
Received on Fri Apr 13 2007 - 02:54:14 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:08 UTC