This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCHv3 0/2] Optimize lock elision for pthread_mutex_t


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(-)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]