History question: Thread-safe profiling instrumentation
Andi Kleen
andi@firstfloor.org
Mon Apr 22 22:20:00 GMT 2013
Bill Schmidt <wschmidt@linux.vnet.ibm.com> writes:
>
> My reason for asking involves a large heavily-threaded application that
> is improved by feedback-directed optimization on some platforms, but not
> on others. One theory is that a defective profile is generated due to
> counter dropouts from contention. I'm somewhat skeptical about this
> given that some platforms seem to do well with it, but it's possible.
> I'm hopeful that knowing why the thread-safe profiling patch wasn't
> implemented will give us more of a clue.
Atomics are slower even single threaded. In any case you'll have a
gigantic slowdown if there is contention. Better use per thread
counters.
-Andi
--
ak@linux.intel.com -- Speaking for myself only
More information about the Gcc
mailing list