]> git.baikalelectronics.ru Git - kernel.git/commit
perf: Tighten (and fix) the grouping condition
authorPeter Zijlstra <peterz@infradead.org>
Fri, 23 Jan 2015 10:19:48 +0000 (11:19 +0100)
committerIngo Molnar <mingo@kernel.org>
Wed, 28 Jan 2015 12:17:35 +0000 (13:17 +0100)
commit4019b592e23f55b882e786c77e6d3c9a79bf51c9
tree79074706175f54d333daf61cc0794aa9d76b1909
parente376501210a167359e21f8ec251d9317551a499f
perf: Tighten (and fix) the grouping condition

The fix from d6f894c5605e ("perf: Fix events installation during
moving group") was incomplete in that it failed to recognise that
creating a group with events for different CPUs is semantically
broken -- they cannot be co-scheduled.

Furthermore, it leads to real breakage where, when we create an event
for CPU Y and then migrate it to form a group on CPU X, the code gets
confused where the counter is programmed -- triggered in practice
as well by me via the perf fuzzer.

Fix this by tightening the rules for creating groups. Only allow
grouping of counters that can be co-scheduled in the same context.
This means for the same task and/or the same cpu.

Fixes: d6f894c5605e ("perf: Fix events installation during moving group")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20150123125834.090683288@infradead.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
include/linux/perf_event.h
kernel/events/core.c