Makes sense.
Understood. If we need that in the near future then it's ok to keep
it, it just did not make any sense from the current code.
But I think you should do this once when you set up the context and
keep that as a separate mask. Right now you evaluate enable_mask and
used_pmcs over and over again.
See above.
Well, my question was: why do we have to stop the counters when an
overflow is pending already ?
The overflow pending is set inside of stop_save() and cleared
somewhere else.
stop_save() is called from pfm_arch_stop() and
pfm_arch_ctxswout_thread(). The first thing it does is to disable the
counters.
Now at some points the counters are obviously reenabled for this
context, but why are they reenabled _before_ the pending overflow has
been resolved ? For N counters that N * 2 wrmsrl() overhead.
Thanks,
tglx
--