[PATCH 2/2] malloc: Use __libc_type to detect an inner libc
Adhemerval Zanella
adhemerval.zanella@linaro.org
Mon Nov 16 13:18:38 GMT 2020
On 13/11/2020 16:05, Florian Weimer wrote:
> * Adhemerval Zanella via Libc-alpha:
>
>> On 13/11/2020 13:14, Florian Weimer via Libc-alpha wrote:
>>> The inner libc must not use sbrk. _dl_addr occasionally shows up
>>> in profiles, but had to be used before because __libc_multiple_libs
>>> was unreliable.
>>
>> LGTM. Is the performance the only advantage of using sbrk on
>> the inner libc?
>
> Avoiding sbrk in the inner libc is required for correctness because sbrk
> is not thread-safe, and there is no external synchronization.
>
> The startup performance improvement comes from not calling _dl_addr. On
> POWER, it saves around 150,000 instructions, according to a quick test.
In fact I meant what is the gain of using sbrk on outer libc. I am asking
because maybe an option would be to use the same strategy regardless whether
it is a inner or outer libc.
More information about the Libc-alpha
mailing list