aboutsummaryrefslogtreecommitdiff
path: root/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
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/lowlevellock.h
parentf63c86fed0ddf38f53de486c5ec537455c00bd52 (diff)
downloadglibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.tar
glibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.tar.gz
glibc-5a414ff70c3a45e52b5f5c0741bd459a84cf56b8.tar.bz2
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/lowlevellock.h')
-rw-r--r--nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
index 864dcbccc0..cabff30be9 100644
--- a/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
+++ b/nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h
@@ -285,6 +285,15 @@ __lll_timedlock (int *futex, const struct timespec *abstime, int private)
#define lll_timedlock(futex, abstime, private) \
__lll_timedlock (&(futex), abstime, private)
+#ifdef ENABLE_LOCK_ELISION
+extern int __lll_timedlock_elision
+ (int *futex, short *adapt_count, const struct timespec *timeout, int private)
+ attribute_hidden;
+
+# define lll_timedlock_elision(futex, adapt_count, timeout, private) \
+ __lll_timedlock_elision(&(futex), &(adapt_count), timeout, private)
+#endif
+
static inline int
__attribute__ ((always_inline))
__lll_robust_timedlock (int *futex, const struct timespec *abstime,
@@ -360,4 +369,22 @@ extern int __lll_timedwait_tid (int *, const struct timespec *)
__res; \
})
+#ifdef ENABLE_LOCK_ELISION
+extern int __lll_lock_elision (int *futex, short *adapt_count, int private)
+ attribute_hidden;
+
+extern int __lll_unlock_elision(int *futex, int private)
+ attribute_hidden;
+
+extern int __lll_trylock_elision(int *futex, short *adapt_count)
+ attribute_hidden;
+
+# define lll_lock_elision(futex, adapt_count, private) \
+ __lll_lock_elision (&(futex), &(adapt_count), private)
+# define lll_unlock_elision(futex, private) \
+ __lll_unlock_elision (&(futex), private)
+# define lll_trylock_elision(futex, adapt_count) \
+ __lll_trylock_elision(&(futex), &(adapt_count))
+#endif
+
#endif /* lowlevellock.h */