Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Apr 2007 11:06:03 -0500
From:      "Rick C. Petty" <rick-freebsd@kiwi-computer.com>
To:        freebsd-fs@FreeBSD.ORG
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: ZFS committed to the FreeBSD base.
Message-ID:  <20070412160603.GB92079@keira.kiwi-computer.com>
In-Reply-To: <86ps6aht1i.fsf@dwp.des.no>
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>

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



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