<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 style>Concerns:</div><div style>* lazy initialization of internal allocator is written using atomics, can it cause significant contention compared to the global mutex?</div><div style>* 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="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>-- <br><div>Alexey Samsonov, MSK</div>
</div></div></div></div></div></div>