diff options
author | Andi Kleen <ak@linux.intel.com> | 2012-12-22 01:03:04 -0800 |
---|---|---|
committer | Andi Kleen <ak@linux.intel.com> | 2013-07-02 08:46:55 -0700 |
commit | e8c659d74e011346785355eeef03b7fb6f533c61 (patch) | |
tree | 7791d2e0769dc19ff7b549be745e4ddc251c3b7a /nptl/ChangeLog | |
parent | 68cc29355f3334c7ad18f648ff9a6383a0916d23 (diff) | |
download | glibc-e8c659d74e011346785355eeef03b7fb6f533c61.tar.gz glibc-e8c659d74e011346785355eeef03b7fb6f533c61.tar.xz glibc-e8c659d74e011346785355eeef03b7fb6f533c61.zip |
Add elision to pthread_mutex_{try,timed,un}lock
Add elision paths to the basic mutex locks. The normal path has a check for RTM and upgrades the lock to RTM when available. Trylocks cannot automatically upgrade, so they check for elision every time. We use a 4 byte value in the mutex to store the lock elision adaptation state. This is separate from the adaptive spin state and uses a separate field. Condition variables currently do not support elision. Recursive mutexes and condition variables may be supported at some point, but are not in the current implementation. Also "trylock" will not automatically enable elision unless some other lock call has been already called on the lock. This version does not use IFUNC, so it means every lock has one additional check for elision. Benchmarking showed the overhead to be negligible.
Diffstat (limited to 'nptl/ChangeLog')
-rw-r--r-- | nptl/ChangeLog | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog index e7495b9eb5..7f82b2098a 100644 --- a/nptl/ChangeLog +++ b/nptl/ChangeLog @@ -1,4 +1,22 @@ 2013-07-02 Andi Kleen <ak@linux.intel.com> + Hongjiu Lu <hongjiu.lu@intel.com> + + * pthread_mutex_lock.c + (__pthread_mutex_lock): Add lock elision support. + * pthread_mutex_timedlock.c (pthread_mutex_timedlock): Likewise. + * pthread_mutex_trylock.c (__pthread_mutex_trylock): Likewise. + * pthread_mutex_unlock.c (__pthread_mutex_unlock_usercnt): Likewise. + * sysdeps/unix/sysv/linux/pthread_mutex_cond_lock.c: Likewise. + * sysdeps/unix/sysv/linux/x86/bits/pthreadtypes.h: Likewise. + * sysdeps/unix/sysv/linux/x86/Makefile: New file. + * sysdeps/unix/sysv/linux/x86/force-elision.h: New file + * sysdeps/unix/sysv/linux/x86/pthread_mutex_cond_lock.c: Likewise. + * sysdeps/unix/sysv/linux/x86/pthread_mutex_lock.c: Likewise. + * sysdeps/unix/sysv/linux/x86/pthread_mutex_timedlock.c: Likewise. + * sysdeps/unix/sysv/linux/x86/pthread_mutex_trylock.c: Likewise. + * sysdeps/unix/sysv/linux/x86/pthread_mutex_unlock.c: Likewise. + +2013-07-02 Andi Kleen <ak@linux.intel.com> * tst-mutex5.c: Include config.h. (do_test): Add checks for ENABLE_LOCK_ELISION. |