[PATCHv3 0/2] Optimize lock elision for pthread_mutex_t
Paul E. Murphy
murphyp@linux.vnet.ibm.com
Thu Sep 3 18:40:00 GMT 2015
Decrementing the adapt_count before entering an elidable critical
section slows down pthread_mutex_lock(). Doing it after the
critical section removes most of this penalty.
In order to achieve this, a new parameter needs to be passed
to the lll_unlock_elision macro. This will not alter the
behavior of the other architectures which choose not to use it.
---
Updates from V2:
* Fix incorrect changes to lll_unlock_elision in
pthread_mutex_unlock.c
* Fix indentation in powerpc/elision-unlock.c
Thank you for the expedient review Andreas!
---
Paul E. Murphy (2):
nptl: Add adapt_count parameter to lll_unlock_elision
powerpc: Optimize lock elision for pthread_mutex_t
nptl/pthread_mutex_unlock.c | 4 ++--
sysdeps/unix/sysv/linux/powerpc/elision-lock.c | 1 -
sysdeps/unix/sysv/linux/powerpc/elision-trylock.c | 1 -
sysdeps/unix/sysv/linux/powerpc/elision-unlock.c | 12 ++++++++++--
sysdeps/unix/sysv/linux/powerpc/lowlevellock.h | 6 +++---
sysdeps/unix/sysv/linux/s390/lowlevellock.h | 2 +-
sysdeps/unix/sysv/linux/x86_64/lowlevellock.h | 2 +-
7 files changed, 17 insertions(+), 11 deletions(-)
More information about the Libc-alpha
mailing list