[v1,0/4] nptl: Add POSIX-proposed pthread_mutex_clocklock function

Message ID cover.4629ad5943e7e21ee61f9a3495c99a465ef961e5.1559564077.git-series.mac@mcrowe.com
Headers show
Series
  • nptl: Add POSIX-proposed pthread_mutex_clocklock function
Related show

Message

Mike Crowe June 3, 2019, 12:15 p.m.
This series builds upon my previous[1] series adding other
POSIX-proposed[2] clockwait/clocklock functions. Since that series
hasn't landed yet, I could combine the two if that would make review
easier.

The series starts by adding the xclock_now() helper function, then
converts a few more nptl tests to use libsupport, before renaming
lll_timedlock to lll_clocklock and adding a clockid parameter before
adding the new function itself:

int pthread_mutex_clocklock (pthread_mutex_t *mutex,
			     clockid_t clockid,
			     const struct timespec *abstime)

along with updating the tests to test it.

I wasn't absolutely certain what to do about the systemtap probe
points in pthread_mutex_timedlock.c. I've continued to support the
existing mutex_timedlock_entry point for pthread_mutex_timedlock and
added a new mutex_clocklock_entry point for pthread_mutex_clocklock.
Unfortunately, this means that __pthread_mutex_timedlock can't just
call __pthread_mutex_clocklock directly.

The lll_timedlock/lll_clocklock changes require modifying the
architecture-specific elision-timed.c files. The changes are
straightforward and appear to work on x86_64, i686, ARM and AArch64,
but I've only compile-and-link-tested them for ppc and s390x.

[1] https://sourceware.org/ml/libc-alpha/2019-05/msg00600.html
[2] http://austingroupbugs.net/view.php?id=1216

Mike Crowe (4):
  support: Add xclock_now helper function.
  nptl: Convert various tests to use libsupport
  nptl: Rename lll_timedlock to lll_clocklock and add clockid parameter
  nptl: Add POSIX-proposed pthread_mutex_clocklock

 ChangeLog                                                       | 135 +++++-
 NEWS                                                            |  10 +-
 nptl/DESIGN-systemtap-probes.txt                                |   3 +-
 nptl/Makefile                                                   |   2 +-
 nptl/Versions                                                   |   1 +-
 nptl/eintr.c                                                    |  12 +-
 nptl/lll_timedlock_wait.c                                       |  11 +-
 nptl/pthread_mutex_timedlock.c                                  |  48 +-
 nptl/tst-abstime.c                                              |   2 +-
 nptl/tst-eintr1.c                                               |  52 +--
 nptl/tst-eintr2.c                                               |  60 +--
 nptl/tst-eintr3.c                                               |  23 +-
 nptl/tst-eintr4.c                                               |  15 +-
 nptl/tst-eintr5.c                                               |  40 +--
 nptl/tst-mutex-errorcheck.c                                     |  29 +-
 nptl/tst-mutex11.c                                              |  69 +++-
 nptl/tst-mutex5.c                                               | 184 +------
 nptl/tst-mutex9.c                                               | 151 +-----
 support/xtime.h                                                 |  10 +-
 sysdeps/nptl/lowlevellock.h                                     |  11 +-
 sysdeps/nptl/pthread.h                                          |   7 +-
 sysdeps/unix/sysv/linux/aarch64/libpthread.abilist              |   1 +-
 sysdeps/unix/sysv/linux/alpha/libpthread.abilist                |   1 +-
 sysdeps/unix/sysv/linux/arm/libpthread.abilist                  |   1 +-
 sysdeps/unix/sysv/linux/csky/libpthread.abilist                 |   1 +-
 sysdeps/unix/sysv/linux/hppa/libpthread.abilist                 |   1 +-
 sysdeps/unix/sysv/linux/i386/libpthread.abilist                 |   1 +-
 sysdeps/unix/sysv/linux/ia64/libpthread.abilist                 |   1 +-
 sysdeps/unix/sysv/linux/m68k/coldfire/libpthread.abilist        |   1 +-
 sysdeps/unix/sysv/linux/m68k/m680x0/libpthread.abilist          |   1 +-
 sysdeps/unix/sysv/linux/microblaze/libpthread.abilist           |   1 +-
 sysdeps/unix/sysv/linux/mips/mips32/libpthread.abilist          |   1 +-
 sysdeps/unix/sysv/linux/mips/mips64/libpthread.abilist          |   1 +-
 sysdeps/unix/sysv/linux/nios2/libpthread.abilist                |   1 +-
 sysdeps/unix/sysv/linux/powerpc/elision-timed.c                 |   6 +-
 sysdeps/unix/sysv/linux/powerpc/lowlevellock.h                  |   9 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc32/libpthread.abilist    |   1 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/be/libpthread.abilist |   1 +-
 sysdeps/unix/sysv/linux/powerpc/powerpc64/le/libpthread.abilist |   1 +-
 sysdeps/unix/sysv/linux/riscv/rv64/libpthread.abilist           |   1 +-
 sysdeps/unix/sysv/linux/s390/elision-timed.c                    |   6 +-
 sysdeps/unix/sysv/linux/s390/lowlevellock.h                     |   9 +-
 sysdeps/unix/sysv/linux/s390/s390-32/libpthread.abilist         |   1 +-
 sysdeps/unix/sysv/linux/s390/s390-64/libpthread.abilist         |   1 +-
 sysdeps/unix/sysv/linux/sh/libpthread.abilist                   |   1 +-
 sysdeps/unix/sysv/linux/sparc/sparc32/libpthread.abilist        |   1 +-
 sysdeps/unix/sysv/linux/sparc/sparc64/libpthread.abilist        |   1 +-
 sysdeps/unix/sysv/linux/x86/elision-timed.c                     |   6 +-
 sysdeps/unix/sysv/linux/x86/lowlevellock.h                      |  11 +-
 sysdeps/unix/sysv/linux/x86_64/64/libpthread.abilist            |   1 +-
 sysdeps/unix/sysv/linux/x86_64/x32/libpthread.abilist           |   1 +-
 51 files changed, 485 insertions(+), 461 deletions(-)
 create mode 100644 nptl/tst-mutex11.c

base-commit: 15ff018a083b887f3a109fb40c2c91ce60d3ac60
-- 
git-series 0.9.1