nptl: Move elision implementations into libc

System Internals / glibc - Florian Weimer [redhat.com] - 23 February 2021 13:59 UTC

The elision interfaces are closely aligned between the targets that implement them, so declare them in the generic file.

Empty .c stubs are provided, so that fewer makefile updates under sysdeps are needed. Also simplify initialization via __libc_early_init.

The symbols __lll_clocklock_elision, __lll_lock_elision, __lll_trylock_elision, __lll_unlock_elision, __pthread_force_elision move into libc. For the time being, non-hidden references are used from libpthread to access them, but once that part of libpthread is moved into libc, hidden symbols will be used again. (Hidden references seem desirable to reduce the likelihood of transactions aborts.)

5a664d7ae8 nptl: Move elision implementations into libc
elf/libc_early_init.c | 6 ++
nptl/Makefile | 5 +
nptl/Versions | 5 +
.../pthread_mutex_lock.c => nptl/elision-conf.c | 9 +-
.../pthread_mutex_lock.c => nptl/elision-lock.c | 9 +-
.../elision-timed.c | 9 +-
.../pthread_mutex_lock.c => nptl/elision-trylock.c | 9 +-
nptl/elision-unlock.c | 17 ++++
nptl/lowlevellock.c | 5 +
nptl/pthread_mutex_lock.c | 15 +--
nptl/pthread_mutex_timedlock.c | 13 ---
nptl/pthread_mutex_trylock.c | 8 --
nptl/pthread_mutex_unlock.c | 4 -
sysdeps/nptl/lowlevellock.h | 102 +++++++++++++++++++++
.../elision-conf.h} | 17 +++-
sysdeps/unix/sysv/linux/powerpc/Makefile | 2 -
sysdeps/unix/sysv/linux/powerpc/elision-conf.c | 26 +-----
sysdeps/unix/sysv/linux/powerpc/elision-conf.h | 8 +-
sysdeps/unix/sysv/linux/powerpc/elision-lock.c | 7 +-
sysdeps/unix/sysv/linux/powerpc/elision-trylock.c | 1 +
sysdeps/unix/sysv/linux/powerpc/elision-unlock.c | 1 +
sysdeps/unix/sysv/linux/powerpc/force-elision.h | 62 -------------
sysdeps/unix/sysv/linux/powerpc/lowlevellock.h | 49 ----------
.../sysv/linux/powerpc/pthread_mutex_cond_lock.c | 22 -----
sysdeps/unix/sysv/linux/s390/Makefile | 3 -
sysdeps/unix/sysv/linux/s390/elision-conf.c | 27 +-----
sysdeps/unix/sysv/linux/s390/elision-conf.h | 8 +-
sysdeps/unix/sysv/linux/s390/elision-lock.c | 7 +-
sysdeps/unix/sysv/linux/s390/elision-trylock.c | 1 +
sysdeps/unix/sysv/linux/s390/elision-unlock.c | 1 +
sysdeps/unix/sysv/linux/s390/force-elision.h | 62 -------------
sysdeps/unix/sysv/linux/s390/lowlevellock.h | 49 ----------
.../unix/sysv/linux/s390/pthread_mutex_cond_lock.c | 22 -----
.../unix/sysv/linux/s390/pthread_mutex_timedlock.c | 22 -----
.../unix/sysv/linux/s390/pthread_mutex_trylock.c | 22 -----
sysdeps/unix/sysv/linux/x86/Makefile | 2 -
sysdeps/unix/sysv/linux/x86/elision-conf.c | 25 +----
sysdeps/unix/sysv/linux/x86/elision-conf.h | 8 +-
sysdeps/unix/sysv/linux/x86/elision-lock.c | 7 +-
sysdeps/unix/sysv/linux/x86/elision-trylock.c | 1 +
sysdeps/unix/sysv/linux/x86/elision-unlock.c | 1 +
sysdeps/unix/sysv/linux/x86/force-elision.h | 62 -------------
sysdeps/unix/sysv/linux/x86/lowlevellock.h | 24 -----
.../unix/sysv/linux/x86/pthread_mutex_cond_lock.c | 22 -----
.../unix/sysv/linux/x86/pthread_mutex_timedlock.c | 22 -----
.../unix/sysv/linux/x86/pthread_mutex_trylock.c | 22 -----
46 files changed, 185 insertions(+), 646 deletions(-)

Upstream: sourceware.org


  • Share