This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] PPC64 linuxthreads perf fix


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
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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]