From: Stephane Eranian Date: Wed, 6 Apr 2011 00:54:54 +0000 (+0200) Subject: perf_event: Fix cgrp event scheduling bug in perf_enable_on_exec() X-Git-Tag: v2.6.39-rc4~17^3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e566b76ed30768140df8f0023904aed5a41244f7;p=pandora-kernel.git perf_event: Fix cgrp event scheduling bug in perf_enable_on_exec() There is a bug in perf_event_enable_on_exec() when cgroup events are active on a CPU: the cgroup events may be scheduled twice causing event state corruptions which eventually may lead to kernel panics. The reason is that the function needs to first schedule out the cgroup events, just like for the per-thread events. The cgroup event are scheduled back in automatically from the perf_event_context_sched_in() function. The patch also adds a WARN_ON_ONCE() is perf_cgroup_switch() to catch any bogus state. Signed-off-by: Stephane Eranian Signed-off-by: Peter Zijlstra Link: http://lkml.kernel.org/r/20110406005454.GA1062@quad Signed-off-by: Ingo Molnar --- Reading git-diff-tree failed