perf: Fix hotplug splat
authorPeter Zijlstra <peterz@infradead.org>
Mon, 24 Feb 2014 11:06:12 +0000 (12:06 +0100)
committerIngo Molnar <mingo@kernel.org>
Thu, 27 Feb 2014 11:38:03 +0000 (12:38 +0100)
commite3703f8cdfcf39c25c4338c3ad8e68891cca3731
treeb4fc6439f43eca37c954ce4d5d2848279b115b99
parent26e61e8939b1fe8729572dabe9a9e97d930dd4f6
perf: Fix hotplug splat

Drew Richardson reported that he could make the kernel go *boom* when hotplugging
while having perf events active.

It turned out that when you have a group event, the code in
__perf_event_exit_context() fails to remove the group siblings from
the context.

We then proceed with destroying and freeing the event, and when you
re-plug the CPU and try and add another event to that CPU, things go
*boom* because you've still got dead entries there.

Reported-by: Drew Richardson <drew.richardson@arm.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will.deacon@arm.com>
Cc: <stable@vger.kernel.org>
Link: http://lkml.kernel.org/n/tip-k6v5wundvusvcseqj1si0oz0@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c