diff options
author | Dominik Vogt <vogt@linux.vnet.ibm.com> | 2014-05-09 16:58:46 +0200 |
---|---|---|
committer | Andreas Krebbel <krebbel@linux.vnet.ibm.com> | 2014-05-09 16:58:46 +0200 |
commit | 5a414ff70c3a45e52b5f5c0741bd459a84cf56b8 (patch) | |
tree | 036ad6a707ea587149cb057f3e41b7bdd086cbdd /nptl/sysdeps/unix/sysv/linux/s390/lowlevellock.h | |
parent | f63c86fed0ddf38f53de486c5ec537455c00bd52 (diff) | |
download | glibc-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.h | 27 |
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 */ |