perf: Fix cgroup event scheduling
authorPeter Zijlstra <[email protected]>
Fri, 8 Jan 2016 08:21:40 +0000 (09:21 +0100)
committerIngo Molnar <[email protected]>
Thu, 21 Jan 2016 17:54:19 +0000 (18:54 +0100)
commit7e41d17753e6e0da55d343997454dd4fbe8d28a8
tree1fb4b3d63f54aff3f54dd008f111ba0631e52a1e
parentc994d6136738fd8b24a79f5ad8df40a6a79e2cf7
perf: Fix cgroup event scheduling

There appears to be a problem in __perf_event_task_sched_in() wrt
cgroup event scheduling.

The normal event scheduling order is:

CPU pinned
Task pinned
CPU flexible
Task flexible

And since perf_cgroup_sched*() only schedules the cpu context, we must
call this _before_ adding the task events.

Note: double check what happens on the ctx switch optimization where
the task ctx isn't scheduled.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
kernel/events/core.c