Messages in this thread | | | Date | Sat, 14 Feb 2009 11:13:32 +1100 | From | Paul Mackerras <> | Subject | Re: [PATCH] Make context switch and migration software counters work again |
| |
Ingo Molnar writes:
> Agreed. Right now we do have some context-switching overhead for > inherited counters, clearly visible in context-switch intense > workloads if they are run via perfstat, so it would be very nice > to optimize this some more.
Yes, that's one of the complaints I have heard from performance tool developers, that the context switch overhead of perf_counters is too high (and specifically, higher than perfmon2/3). We do a lot of work on each context switch updating counter values (involving a couple of atomic operations per counter), setting counter states etc., and (on POWER) computing PMU configurations, that either isn't really necessary or could be cached. Also, it might be useful to do lazy PMU switching like we do with the FPU to reduce the overhead further when only one task is using the PMU. That's all going to make the code more complex, though. :)
Paul.
| |