Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2007 22:43:05 +0200
From:      des@des.no (Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?=)
To:        Craig Boston <craig@xfoil.gank.org>
Cc:        freebsd-fs@FreeBSD.ORG, "Rick C. Petty" <rick-freebsd@kiwi-computer.com>, freebsd-current@FreeBSD.ORG
Subject:   Re: ZFS committed to the FreeBSD base.
Message-ID:  <86slb5e33a.fsf@dwp.des.no>
In-Reply-To: <20070412185159.GB95302@nowhere> (Craig Boston's message of "Thu,  12 Apr 2007 13:51:59 -0500")
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
Craig Boston <craig@xfoil.gank.org> 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



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