This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCHv3 0/2] Optimize lock elision for pthread_mutex_t
- From: "Paul E. Murphy" <murphyp at linux dot vnet dot ibm dot com>
- To: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, schwab at linux-m68k dot org, Tulio Magno Quites Machado Filho <tuliom at linux dot vnet dot ibm dot com>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>
- Date: Thu, 03 Sep 2015 13:39:56 -0500
- Subject: [PATCHv3 0/2] Optimize lock elision for pthread_mutex_t
- Authentication-results: sourceware.org; auth=none
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(-)