[PATCH] x86-64: Align the stack in __tls_get_addr [BZ #21609]

Carlos O'Donell carlos@redhat.com
Fri Jul 7 15:52:00 GMT 2017


On 07/06/2017 04:17 PM, Florian Weimer wrote:
> On 07/06/2017 06:23 PM, Alexander Monakov wrote:
>> On Thu, 6 Jul 2017, Carlos O'Donell wrote:
>>> Option (b) has been chosen for this release, so that's what we're doing for
>>> the release, but we can continue to discuss the optimization here.
>>>
>>> (1) Cost.
>>>
>>> No matter what you do it's extra instructions on the hot path forever.
>>
>> What extra instructions on the hot path?  I don't see any.  There's no
>> need to check stack alignment on the hot path -- only on the slow path.
> 
> Indeed, the x86-64 fast path is identical to the GCC-compiled version in
> current master.

My apologies, when I wrote 'hot path' I was thinking of process startup
where the first call to __tls_get_addr (for a given dtv entry) always goes
through the slow path.

The reason I still want to highlight this is that there is a non-zero
cost paid, and it adds up over time with other decisions we make.

So while profiling is important, eventually we don't see any particular
peak in the profile, just a lot of costly noise which is hard to speed
up without a deeper understanding of the infrastructure and how we want
it to work.

-- 
Cheers,
Carlos.



More information about the Libc-alpha mailing list