This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC 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]

Re: Failure to dlopen libgomp due to static TLS data


On Fri, Feb 13, 2015 at 10:12:11AM +1030, Alan Modra wrote:
> On Thu, Feb 12, 2015 at 12:07:24PM -0500, Rich Felker wrote:
> > On Thu, Feb 12, 2015 at 08:56:26AM -0800, H.J. Lu wrote:
> > > On Thu, Feb 12, 2015 at 8:11 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > > > On Thu, Feb 12, 2015 at 11:09:59AM -0500, Rich Felker wrote:
> > > >> On Thu, Feb 12, 2015 at 04:18:57PM +0100, Ulrich Weigand wrote:
> > > >> > Hello,
> > > >> >
> > > >> > we're running into a problem related to use of initial-exec access to
> > > >> > TLS variables in dynamically-loaded libraries.  Now, in general, this
> > > >> > is actually not supported.  However, there seems to an "inofficial"
> > > >> > extension that allows selected system libraries to use small amounts
> > > >> > of static TLS space to allow critical variables to be defined to use
> > > >> > the initial-exec model even in dynamically-loaded libraries.
> > > >>
> > > >> This usage is supposed to be deprecated. Why isn't libgomp using
> > > >> TLSDESC/gnu2 model?
> > > >
> > > > Because it is significantly slower.
> > > 
> > > And TLSDESC/gnu2 model isn't implemented for x32.
> > > There are no tests for TLSDESC/gnu2 model in glibc.
> > > I have no ideas if it works in glibc master on x86-32 or
> > > x86-64 today.
> > 
> > Then fixing this should be a priority, IMO. Broken libraries using IE
> > model "for performance" are a problem that's not going to go away
> > until TLSDESC gets properly adopted.
> 
> I posted support for TLSDESC on powerpc back in 2009 (search for
> powerpc _tls_get_addr call optimization).  The patch wasn't reviewed,
> and I didn't push it because my benchmark tests didn't show a much of
> a gain.  Quite possibly I wasn't using the right benchmark.

Were you measuring static-allocated TLSDESC vs non-TLSDESC GD model?
That's the case where there should be a "big" difference, though I'm
still somewhat skeptical of the benefits in real-world usage cases.

I think Alexandre Oliva had a tool along with the original paper to
measure the performance, and I did some simple testing myself a while
back I could dig up the source for.

Rich


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