This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Fixes TLS performance degradation after dlopen
- From: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- To: Philipp Trommler <philipp dot trommler at mailbox dot tu-dresden dot de>, <libc-alpha at sourceware dot org>
- Cc: <nd at arm dot com>
- Date: Tue, 14 Jun 2016 17:18:46 +0100
- Subject: Re: [PATCH] Fixes TLS performance degradation after dlopen
- Authentication-results: sourceware.org; auth=none
- Nodisclaimer: True
- References: <1465309688 dot 1188 dot 19 dot camel at mailbox dot tu-dresden dot de>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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.