about summary refs log tree commit diff
path: root/nptl/sysdeps/unix/sysv/linux/s390/bits
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2014-05-09 16:58:46 +0200
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-05-09 16:58:46 +0200
commit5a414ff70c3a45e52b5f5c0741bd459a84cf56b8 (patch)
tree036ad6a707ea587149cb057f3e41b7bdd086cbdd /nptl/sysdeps/unix/sysv/linux/s390/bits
parentf63c86fed0ddf38f53de486c5ec537455c00bd52 (diff)
downloadglibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.tar.gz
glibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.tar.xz
glibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.zip
S/390: Port of lock elision to System/z
Added support for TX lock elision of pthread mutexes on s390 and
s390x.  This may improve lock scaling of existing programs on TX
capable systems.  The lock elision code is only built with
--enable-lock-elision=yes and then requires a GCC version supporting
the TX builtins.  With lock elision default mutexes are elided via
__builtin_tbegin, if the cpu supports transactions. By default lock
elision is not enabled and the elision code is not built.
Diffstat (limited to 'nptl/sysdeps/unix/sysv/linux/s390/bits')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
index 8264de0591..d70f8b35b1 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/bits/pthreadtypes.h
@@ -89,14 +89,37 @@ typedef union
        binary compatibility.  */
     int __kind;
 #if __WORDSIZE == 64
+# ifdef ENABLE_LOCK_ELISION
+    short __spins;
+    short __elision;
+    /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.  */
+#  define __PTHREAD_SPINS               0, 0
+# else
     int __spins;
+    /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.  */
+#  define __PTHREAD_SPINS               0
+# endif
     __pthread_list_t __list;
 # define __PTHREAD_MUTEX_HAVE_PREV	1
 #else
     unsigned int __nusers;
     __extension__ union
     {
+# ifdef ENABLE_LOCK_ELISION
+      struct
+      {
+	short __espins;
+	short __elision;
+      } _d;
+#  define __spins _d.__espins
+#  define __elision _d.__elision
+    /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.  */
+#  define __PTHREAD_SPINS               { 0, 0 }
+# else
       int __spins;
+    /* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.  */
+#  define __PTHREAD_SPINS               0
+# endif
       __pthread_slist_t __list;
     };
 #endif
@@ -105,8 +128,6 @@ typedef union
   long int __align;
 } pthread_mutex_t;
 
-/* Mutex __spins initializer used by PTHREAD_MUTEX_INITIALIZER.  */
-#define __PTHREAD_SPINS 0
 
 typedef union
 {