Patch to use fence instructions

John Baldwin jhb at FreeBSD.org
Wed Sep 21 12:16:40 PDT 2005


On Wednesday 21 September 2005 07:45 am, Martin Nilsson wrote:
> John Baldwin wrote:
> > This patch changes the atomic operations and bus space barriers to use
> > the x86 fence instructions.  Please test, thanks!
> >
> > http://www.FreeBSD.org/~jhb/patches/amd64_fences.patch
>
> What kind of performance improvements can we expect with this patch?
> Is it worthwile to compare performance on dualcore Pentium D with
> sysbench before and after this patch? Does it affect threads & mutex
> performance?
>
> Sysbench is a benchmark specially made to determine lowlevel performance
> important for MySQL and be found here: http://sysbench.sourceforge.net/

I'm not sure what improvements it would provide (I don't have any amd64 
hardware to test on anyway).  I believe that in some microbenchmarks bde@ 
found that just using lfence or sfence was only about half the cost of using 
the 'lock' prefix.  Thus, things like atomic_store_rel (used in mutexes) 
might perform better.

-- 
John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org


More information about the freebsd-amd64 mailing list