Re: [PATCH 2/2] perf_counter: optimize context switch between identical inherited contexts

Peter Zijlstra
2009-05-22T08:16:23Z

On Fri, 2009-05-22 at 14:27 +1000, Paul Mackerras wrote:
> Since we don't have individual fds for the counters in a cloned
> context, the only thing that can make two clones of a given parent
> different after they have been cloned is enabling or disabling all
> counters with prctl. To account for this, we keep a count of the
> number of enabled counters in each context. Two contexts must have
> the same number of enabled counters to be considered equivalent.

Curious point that.. so prctl() can disable counters it doesn't own.

Shouldn't we instead fix that?