perf: Remove redundant PMU assignment
authorMark Rutland <mark.rutland@arm.com>
Mon, 10 Feb 2014 17:44:19 +0000 (17:44 +0000)
committerIngo Molnar <mingo@kernel.org>
Thu, 27 Feb 2014 11:43:24 +0000 (12:43 +0100)
commitfdded676c3ef680bf1abc415d307d7e69a6768d1
tree1e279e330e37d4ef5e096872512f902792334959
parent9e3170411ed171a126f4dca1672012a33efe59e5
perf: Remove redundant PMU assignment

Currently perf_branch_stack_sched_in iterates over the set of pmus,
checks that each pmu has a flush_branch_stack callback, then overwrites
the pmu before calling the callback. This is either redundant or broken.

In systems with a single hw pmu, pmu == cpuctx->ctx.pmu, and thus the
assignment is redundant.

In systems with multiple hw pmus (i.e. multiple pmus with task_ctx_nr ==
perf_hw_context) the pmus share the same perf_cpu_context. Thus the
assignment can cause one of the pmus to flush its branch stack
repeatedly rather than causing each of the pmus to flush their branch
stacks. Worse still, if only some pmus have the callback the assignment
can result in a branch to NULL.

This patch removes the redundant assignment.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1392054264-23570-3-git-send-email-mark.rutland@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c