[PATCH] Fixes TLS performance degradation after dlopen
Szabolcs Nagy
szabolcs.nagy@arm.com
Tue Jun 14 16:19:00 GMT 2016
On 07/06/16 15:28, Philipp Trommler wrote:
> Fixes a performance degradation of TLS access in shared libraries which
> can be observed after another shared library that uses TLS is loaded
> via dl_open. In this case __tls_get_addr takes significant more time.
> Once that shared library accesses it's TLS, the performance normalizes.
>
...
> I strongly suspect this is the same issue as discussed in this post on
> the µClibc mailing list:
>
> https://lists.osuosl.org/pipermail/uclibc/2009-December/043375.html
>
...
> The patch provided touches code already altered (but not released) by
> the work on bug 19329.
>
BZ 19329 is a correctness issue, this is a performance
optimization, but it also addresses some of the
synchronization problems around dl_tls_generation.
my guess would be that it's cleaner to address the
correctness issues first and then do the optimization
by only changing _dl_update_slotinfo later (to always
update dtv up to the current dl_tls_generation) since
adding memory barriers is a mostly independent change.
More information about the Libc-alpha
mailing list