Re: [PATCH] Make context switch and migration software counterswork again

From: Paul Mackerras
Date: Fri Feb 13 2009 - 19:13:51 EST


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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/