<div dir="ltr">FTR one more note: it is critical that all TSan internal allocations are done using the primary allocator (i.e. don't fall back to mmap). So even though we may think<div>of using more compact size class map, it still should be capable of allocating large enough chunks (of size NThreads * 8 bytes).</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 26, 2013 at 4:33 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:samsonov@google.com" target="_blank">samsonov@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Attaching the patch for the updated version. It adds thread-local caches for internal_allocator to TSan threads (in the same way as we do for user allocations).<div>
users of internal allocator may choose not to provide thread-local cache, in this case allocation would require a global lock.<br>
<div><br></div><div>Concerns:</div><div>* lazy initialization of internal allocator is written using atomics, can it cause significant contention compared to the global mutex?</div><div>* TSan memory usage might increase after this change due to per-thread caches.</div>

<div><div><div><br></div><div><div class="gmail_extra"><div class="im"><div class="gmail_quote">On Mon, Apr 22, 2013 at 1:28 PM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
  As per offline discussion, Alexey will measure overhead of the single mutex on tsan performance. If the slowdown is negligible, we can use it. Otherwise we need to think about per-thread caches will all the required machinery.<br>


<br>
<a href="http://llvm-reviews.chandlerc.com/D671" target="_blank">http://llvm-reviews.chandlerc.com/D671</a></blockquote></div><br clear="all"><div><br></div></div><span class="HOEnZb"><font color="#888888">-- <br><div>Alexey Samsonov, MSK</div>

</font></span></div></div></div></div></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Alexey Samsonov, MSK</div>
</div>