[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)

Kostya Serebryany kcc at google.com
Thu Apr 17 09:48:24 PDT 2014


On Thu, Apr 17, 2014 at 8:45 PM, Jonathan Roelofs <jonathan at codesourcery.com
> wrote:

> if (counter_is_local)
>   counter++
>   if (counter > threshold)
>     counter_is_local=false
> else
>   increment_thread_local_counter()


This might be another choice, but unless you implement
increment_thread_local_counter() in some clever way
it will still require the same RAM overhead as just keeping the counters in
TLS


>
> On 4/17/14, 9:39 AM, Kostya Serebryany wrote:
>
>>
>>
>>
>> On Thu, Apr 17, 2014 at 8:37 PM, Jonathan Roelofs <
>> jonathan at codesourcery.com
>> <mailto:jonathan at codesourcery.com>> wrote:
>>
>>     How about per-thread if the counter is hot enough?
>>
>>
>> Err. How do you know if the counter is hot w/o first profiling the app?
>>
>>
> --
> Jon Roelofs
> jonathan at codesourcery.com
> CodeSourcery / Mentor Embedded
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140417/1f4fcf96/attachment.html>


More information about the llvm-dev mailing list