On Thu Aug 12 2021, Adhemerval Zanella wrote: > On 12/08/2021 03:42, Kurt Kanzenbach wrote: >> Hi Adhemerval, >> >> thanks for the respin of this series. Just some minor comments below. >> >> On Wed Aug 11 2021, Adhemerval Zanella wrote: >>> This patch uses the new futex PI operation provided by Linux v5.14 >>> when it is required. >>> >>> The futex_lock_pi64() is moved to futex-internal.c (since it used on >>> two different places and its code size might be large depending of the >>> kernel configuration) and clockid is added as an argument. >>> >>> Co-authored-by: Kurt Kanzenbach >>> --- >>> nptl/futex-internal.c | 63 +++++++++++++++++++++++++++++++ >>> nptl/pthread_mutex_lock.c | 3 +- >>> nptl/pthread_mutex_timedlock.c | 3 +- >>> sysdeps/nptl/futex-internal.h | 54 +------------------------- >>> sysdeps/nptl/lowlevellock-futex.h | 1 + >>> 5 files changed, 70 insertions(+), 54 deletions(-) >>> >>> diff --git a/nptl/futex-internal.c b/nptl/futex-internal.c >>> index e74647a9d4..58605b2fca 100644 >>> --- a/nptl/futex-internal.c >>> +++ b/nptl/futex-internal.c >>> @@ -140,3 +140,66 @@ __futex_abstimed_wait_cancelable64 (unsigned int* futex_word, >>> abstime, private, true); >>> } >>> libc_hidden_def (__futex_abstimed_wait_cancelable64) >>> + >>> +int >>> +__futex_lock_pi64 (int *futex_word, clockid_t clockid, >>> + const struct __timespec64 *abstime, int private) >>> +{ >>> + int err; >> >> Is the clockid check not needed? >> >> if (! lll_futex_supported_clockid (clockid)) >> return EINVAL; > > The ___pthread_mutex_clocklock64() already checks it (as other functions that uses > a clockid_t). I also tested for invalid clocks on tst-mutexpi10.c. > > And I think that the check on __futex_abstimed_wait_common() is superfluous.. OK, I see. Thanks, Kurt