On 2012/1/19 23:23, John Baldwin wrote:
On Thursday, January 19, 2012 12:57:50 am David Xu wrote:
rdtsc() may not work on SMP, so I have updated it to use clock_gettime
to get total time.
http://people.freebsd.org/~davidxu/bench/semaphore2/
<http://people.freebsd.org/%7Edavidxu/bench/semaphore2/>

Still, lfence is a lot faster than atomic lock.
http://www.freebsd.org/~jhb/patches/amd64_fence.patch

This the patch I've had for quite a while.  Can you retest with this?  You'll
probably have to install the updated header in /usr/include as well.

The lines in atomic_load_acq() seem not what I want:

+       v = *p;                                         \
+       __asm __volatile("lfence" ::: "memory");    \

I think they should be swapped ?

+       __asm __volatile("lfence" ::: "memory");    \
+       v = *p;                                         \

What I need in the semaphore code is read can not pass write in such a special 
case.

_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to