Kostya Serebryany
2014-Apr-17 16:39 UTC
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
On Thu, Apr 17, 2014 at 8:37 PM, Jonathan Roelofs <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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140417/f340951e/attachment.html>
Jonathan Roelofs
2014-Apr-17 16:45 UTC
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
if (counter_is_local)
counter++
if (counter > threshold)
counter_is_local=false
else
increment_thread_local_counter()
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
Kostya Serebryany
2014-Apr-17 16:48 UTC
[LLVMdev] multithreaded performance disaster with -fprofile-instr-generate (contention on profile counters)
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>