[PATCH] nptl: Use out-of-line wake function in __libc_lock_unlock slow path
Adhemerval Zanella
adhemerval.zanella@linaro.org
Thu Jul 8 18:27:31 GMT 2021
On 08/07/2021 15:24, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>>> diff --git a/nptl/lowlevellock.c b/nptl/lowlevellock.c
>>> index 2d077d8694..4f88178964 100644
>>> --- a/nptl/lowlevellock.c
>>> +++ b/nptl/lowlevellock.c
>>> @@ -52,6 +52,20 @@ __lll_lock_wait (int *futex, int private)
>>> }
>>> libc_hidden_def (__lll_lock_wait)
>>>
>>> +void
>>> +__lll_lock_wake_private (int *futex)
>>> +{
>>> + lll_futex_wake (futex, 1, LLL_PRIVATE);
>>> +}
>>> +libc_hidden_def (__lll_lock_wake_private)
>>> +
>>> +void
>>> +__lll_lock_wake (int *futex, int private)
>>> +{
>>> + lll_futex_wake (futex, 1, private);
>>> +}
>>> +libc_hidden_def (__lll_lock_wake)
>>> +
>>> #if ENABLE_ELISION_SUPPORT
>>> int __pthread_force_elision __attribute__ ((nocommon));
>>> libc_hidden_data_def (__pthread_force_elision)
>>
>> Do we really need two functions for this?
>
> It mirrors the wait side, which has two functions as well. We probably
> only need __lll_lock_wake_private these days, but I didn't want to start
> cleaning up the libc-lock implementation with its deep macro nesting.
Fair enough.
Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
More information about the Libc-alpha
mailing list