[PATCH] nptl: Use out-of-line wake function in __libc_lock_unlock slow path

Florian Weimer fweimer@redhat.com
Thu Jul 8 18:24:21 GMT 2021


* 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.

Thanks,
Florian



More information about the Libc-alpha mailing list