This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] x86-64: Align the stack in __tls_get_addr [BZ #21609]
On Fri, Jul 07, 2017 at 08:13:49PM +0300, Alexander Monakov wrote:
> On Fri, 7 Jul 2017, Carlos O'Donell wrote:
> > 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.
>
> In this case you're talking about literally 5 instructions on paths that
> involve syscalls and thousands of other instructions.
And it could be even 2 (have the fast path done for when __tls_get_addr
has been called on that TLS object already first, then
testb $15, %spl
je __tls_get_addr_slow
! Now do the actual stack realignment and __tls_get_addr_slow call
(or testl $15, %esp; whatever is faster).
Jakub