public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Add CLOCK_MONOTONIC support for PI mutexes
@ 2021-09-06 20:47 Adhemerval Zanella
  2021-09-06 20:47 ` [PATCH v3 1/4] Linux: Add FUTEX_LOCK_PI2 Adhemerval Zanella
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Adhemerval Zanella @ 2021-09-06 20:47 UTC (permalink / raw)
  To: libc-alpha

It adds support for CLOCK_MONOTONIC for PI mutexes by using the new
Linux v5.14 FUTEX_LOCK_PI2 operation.  Similar to current approach,
pthread_mutex_clocklock might return EINVAL if the underlying kernel
has no support for the futex operation.

Changes since v2:

  * Renamed xpthread_mutex_pi_support_monotonic to
    support_mutex_pi_monotonic.

Changes since v1:
  
  * Refactor futex_lock_pi64 and avoid adding futex_lock_pi2.  The
    FUTEX_LOCK_PI2 logic is done at only one place, so the code change
    on pthread routines are minimal.  Also, FUTEX_LOCK_PI2 is only
    used if it is really required, i.e, when a timeout against
    CLOCK_MONOTONIC is used.
  * Do not remove nptl/tst-mutexpi10.c, but instead adjust it to new
    FUTEX_LOCK_PI2 support.
  * Add pthread_mutex_pi_support_monotonic() to check if monotonic
    clock with PI mutexes are supported and use on test to check for
    the expected result.

Adhemerval Zanella (3):
  nptl: Use FUTEX_LOCK_PI2 when available
  support: Add support_mutex_pi_monotonic
  nptl: Add CLOCK_MONOTONIC support for PI mutexes

Kurt Kanzenbach (1):
  Linux: Add FUTEX_LOCK_PI2

 nptl/futex-internal.c                     | 63 +++++++++++++++++++++++
 nptl/pthread_mutex_lock.c                 |  3 +-
 nptl/pthread_mutex_timedlock.c            | 10 +---
 nptl/tst-mutexpi10.c                      | 42 +++++++++------
 support/Makefile                          |  1 +
 support/support_mutex_pi_monotonic.c      | 33 ++++++++++++
 support/xthread.h                         |  4 ++
 sysdeps/nptl/futex-internal.h             | 58 ++-------------------
 sysdeps/nptl/lowlevellock-futex.h         |  1 +
 sysdeps/pthread/tst-mutex5.c              | 23 ++++++---
 sysdeps/pthread/tst-mutex9.c              | 20 ++++---
 sysdeps/unix/sysv/linux/kernel-features.h |  8 +++
 12 files changed, 172 insertions(+), 94 deletions(-)
 create mode 100644 support/support_mutex_pi_monotonic.c

-- 
2.30.2


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-10-01 11:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 20:47 [PATCH v3 0/4] Add CLOCK_MONOTONIC support for PI mutexes Adhemerval Zanella
2021-09-06 20:47 ` [PATCH v3 1/4] Linux: Add FUTEX_LOCK_PI2 Adhemerval Zanella
2021-09-06 20:47 ` [PATCH v3 2/4] nptl: Use FUTEX_LOCK_PI2 when available Adhemerval Zanella
2021-09-06 20:47 ` [PATCH v3 3/4] support: Add support_mutex_pi_monotonic Adhemerval Zanella
2021-09-06 20:47 ` [PATCH v3 4/4] nptl: Add CLOCK_MONOTONIC support for PI mutexes Adhemerval Zanella
2021-09-27 13:48 ` [PATCH v3 0/4] " Adhemerval Zanella
2021-10-01 11:42   ` Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).