[PATCH] PPC64 linuxthreads perf fix

Steven Munroe sjmunroe@us.ibm.com
Thu Sep 11 18:24:00 GMT 2003


Due to an oversite the linuxthreads code for PPC64 is still using sync as only
form of MEMORY_BARRIER. This is really bad on the new large (Power4)
processors. Should use lwsync or eieio as appropriate.

2003-09-11  Steven Munroe  <sjmunroe@us.ibm.com>

        * sysdeps/powerpc/powerpc64/pt-machine.h [MEMORY_BARRIER]: Use lwsync.
	[READ_MEMORY_BARRIER]: Define.
	[WRITE_MEMORY_BARRIER]: Define.


-- 
Steven Munroe
sjmunroe@us.ibm.com
Linux on PowerPC-64 Development
GLIBC for PowerPC-64 Development
-------------- next part --------------
diff -urN libc23-cvstip-20030911/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h libc23/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h
--- libc23-cvstip-20030911/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h	2003-07-31 14:15:43.000000000 -0500
+++ libc23/linuxthreads/sysdeps/powerpc/powerpc64/pt-machine.h	2003-09-11 12:27:34.000000000 -0500
@@ -34,7 +34,9 @@
 /* For multiprocessor systems, we want to ensure all memory accesses
    are completed before we reset a lock.  On other systems, we still
    need to make sure that the compiler has flushed everything to memory.  */
-#define MEMORY_BARRIER() __asm__ __volatile__ ("sync" : : : "memory")
+#define MEMORY_BARRIER() __asm__ __volatile__ ("lwsync" : : : "memory")
+#define READ_MEMORY_BARRIER() __asm__ __volatile__ ("lwsync" : : : "memory")
+#define WRITE_MEMORY_BARRIER() __asm__ __volatile__ ("eieio" : : : "memory")
 
 /* We want the OS to assign stack addresses.  */
 #define FLOATING_STACKS 1


More information about the Libc-alpha mailing list