]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Fix perf_pmu_migrate_context
authorPeter Zijlstra <peterz@infradead.org>
Thu, 3 Oct 2013 14:02:23 +0000 (16:02 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 4 Oct 2013 07:58:53 +0000 (09:58 +0200)
commitdaca7b62dc52e93831950654bc1b4529057a6216
treedff8fb937ae2c73fe474263da0e906aa77d6ae54
parent9fea2c13302d6c9483bb553c230bf91985bdfe21
perf: Fix perf_pmu_migrate_context

While auditing the list_entry usage due to a trinity bug I found that
perf_pmu_migrate_context violates the rules for
perf_event::event_entry.

The problem is that perf_event::event_entry is a RCU list element, and
hence we must wait for a full RCU grace period before re-using the
element after deletion.

Therefore the usage in perf_pmu_migrate_context() which re-uses the
entry immediately is broken. For now introduce another list_head into
perf_event for this specific usage.

This doesn't actually fix the trinity report because that never goes
through this code.

Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-mkj72lxagw1z8fvjm648iznw@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/perf_event.h
kernel/events/core.c