This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug dynamic-link/19924] New: TLS performance degradation after dlopen


https://sourceware.org/bugzilla/show_bug.cgi?id=19924

            Bug ID: 19924
           Summary: TLS performance degradation after dlopen
           Product: glibc
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: dynamic-link
          Assignee: unassigned at sourceware dot org
          Reporter: philipp.trommler at mailbox dot tu-dresden.de
  Target Milestone: ---

Created attachment 9165
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9165&action=edit
Patch that fixes the TLS performance degradation after dlopen

Hello,

we have noticed a performance degradation of TLS access in shared libraries. If
another shared library that uses TLS is loaded via dlopen, __tls_get_addr takes
significant more time. Once that shared library accesses it's TLS, the
performance normalizes.


Attached is a minimal example which gives the following output:

time: 0.723744
after dlopen,
time: 1.789016
after tls access in loaded lib,
time: 0.672865

We do have a use-case where this is actually really significant. I believe this
happens for instance if libstdc++ is loaded implicitly, but TLS features are
not actively used.


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

and therefore the patch provided mainly reuses the solution they've found for
ÂClibc.


Main development platform information (tested on multiple platforms):

* latest glibc git version (pulled at Fri Apr  8 10:50:19 CEST 2016)
* x86_64-pc-linux-gnu (but should be independent)
* Linux vishnu 4.2.0-23-generic #28-Ubuntu SMP Sun Dec 27 17:47:31 UTC 2015
x86_64 x86_64 x86_64 GNU/Linux
* gcc version 5.2.1 20151010 (Ubuntu 5.2.1-22ubuntu2)
* GNU ld (GNU Binutils for Ubuntu) 2.25.1


The patch provided touches code already altered (but not released) by the work
on bug 19329.

Regards,
Philipp Trommler.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]