]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Simplify and fix __perf_install_in_context()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Sat, 9 Apr 2011 19:17:44 +0000 (21:17 +0200)
committerIngo Molnar <mingo@elte.hu>
Sat, 28 May 2011 16:01:16 +0000 (18:01 +0200)
commit6f737c4882163d11b00c57d4da0f9562b0f6b4ab
tree64a0c86177213e8490ecc74a1b4f881c4d9633ec
parent273f17c3b77874d3aceef7987b88050abd5dcc9b
perf: Simplify and fix __perf_install_in_context()

Currently __perf_install_in_context() will try and schedule in the
event irrespective of our event scheduling rules, that is, we try to
schedule CPU-pinned, TASK-pinned, CPU-flexible, TASK-flexible, but
when creating a new event we simply try and schedule it on top of
whatever is already on the PMU, this can lead to errors for pinned
events.

Therefore, simplify things and simply schedule everything out, add the
event to the corresponding context and schedule everything back in.

This also nicely handles the case where with
__ARCH_WANT_INTERRUPTS_ON_CTXSW the IPI can come right in the middle
of schedule, before we managed to call perf_event_task_sched_in().

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20110409192141.870894224@chello.nl
Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/events/core.c