perf: Fix inherit vs. context rotation bug

It was found that sometimes children of tasks with inherited events had
one extra event. Eventually it turned out to be due to the list rotation
no being exclusive with the list iteration in the inheritance code.

Cure this by temporarily disabling the rotation while we inherit the events.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Cc: <stable@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Thomas Gleixner 2010-11-24 10:05:55 +01:00 committed by Ingo Molnar
parent 02a9d03772
commit dddd3379a6
2 changed files with 21 additions and 2 deletions

View file

@ -850,6 +850,7 @@ struct perf_event_context {
int nr_active;
int is_active;
int nr_stat;
int rotate_disable;
atomic_t refcount;
struct task_struct *task;