Date: Tue, 21 Jun 2011 09:32:39 -0700 From: Jason Evans <jasone@canonware.com> To: Marius Strobl <marius@alchemy.franken.de> Cc: freebsd-current@freebsd.org, Nathaniel W Filardo <nwf@cs.jhu.edu>, jasone@freebsd.org, freebsd-sparc64@freebsd.org Subject: Re: TLS bug? Message-ID: <4E00C7A7.8080704@canonware.com> In-Reply-To: <20110617213532.GG7064@alchemy.franken.de> References: <20110616073138.GL31996@gradx.cs.jhu.edu> <20110616075319.GM31996@gradx.cs.jhu.edu> <20110617180713.GA5300@alchemy.franken.de> <20110617193129.GC4764@gradx.cs.jhu.edu> <20110617213532.GG7064@alchemy.franken.de>
next in thread | previous in thread | raw e-mail | index | archive | help
On 06/17/2011 02:35 PM, Marius Strobl wrote: > On Fri, Jun 17, 2011 at 03:31:29PM -0400, Nathaniel W Filardo wrote: >> On Fri, Jun 17, 2011 at 08:07:13PM +0200, Marius Strobl wrote: >>> Using bonnie++ I can't reproduce this (didn't try mysql) but I have >> >> I seem to have good luck reproducing it with "-r 5 -s 10 -x 10" by about the >> third iteration. > > Ok, with these parameters I can reproduce it. > >> >>> some TLS fixes for libthr I forgot about but could be relevant here >>> (most actually date back to 2008 when the base binutils didn't support >>> GNUTLS for sparc64 so I couldn't test them easily). Could you please >>> give a libthr build with the following patch a try? >>> http://people.freebsd.org/~marius/libthr_sparc64.diff >> >> Concurrent runs both with and without those diffs still asserted. >> Interestingly, libc's .tbss section, even after the assertion, is still full >> of zeros, so it looks like something stranger than a wild-write back to >> .tbss. I'll go diving through the tls allocation code again when I get a >> minute. >> > > In combination with the below patch bonnie++ survived 100 iterations > here. I'm not sure what this means though as I don't have much knowledge > about TLS, I merely implemented the necessary relocations. Could be > that malloc() actually requires the initial exec model for variant II. > Unfortunately, it's not documented why it was added for x86. > Jason, can you shed some light on this? > > Marius > > Index: malloc.c > =================================================================== > --- malloc.c (revision 219535) > +++ malloc.c (working copy) > @@ -234,7 +234,7 @@ > #ifdef __sparc64__ > # define LG_QUANTUM 4 > # define LG_SIZEOF_PTR 3 > -# define TLS_MODEL /* default */ > +# define TLS_MODEL __attribute__((tls_model("initial-exec"))) > #endif > #ifdef __amd64__ > # define LG_QUANTUM 4 > I added the initial-exec TLS_MODEL because it is faster than the default; jemalloc in no way depends on this for correctness though, so your patch is safe. Thanks, Jason
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4E00C7A7.8080704>