diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:42:56 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-01-28 15:42:56 +0100 |
commit | f10698ed6807dc41d021fb7baeb24f9bc4051837 (patch) | |
tree | fe9229efe38ad31788843a7535bfc3feb89f79a7 /kernel/events | |
parent | perf: Avoid horrible stack usage (diff) | |
parent | Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kerne... (diff) | |
download | linux-f10698ed6807dc41d021fb7baeb24f9bc4051837.tar.xz linux-f10698ed6807dc41d021fb7baeb24f9bc4051837.zip |
Merge branch 'perf/urgent' into perf/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index c10124b772c4..b4a696c4dc76 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6787,7 +6787,6 @@ skip_type: __perf_event_init_context(&cpuctx->ctx); lockdep_set_class(&cpuctx->ctx.mutex, &cpuctx_mutex); lockdep_set_class(&cpuctx->ctx.lock, &cpuctx_lock); - cpuctx->ctx.type = cpu_context; cpuctx->ctx.pmu = pmu; __perf_cpu_hrtimer_init(cpuctx, cpu); @@ -7431,7 +7430,19 @@ SYSCALL_DEFINE5(perf_event_open, * task or CPU context: */ if (move_group) { - if (group_leader->ctx->type != ctx->type) + /* + * Make sure we're both on the same task, or both + * per-cpu events. + */ + if (group_leader->ctx->task != ctx->task) + goto err_context; + + /* + * Make sure we're both events for the same CPU; + * grouping events for different CPUs is broken; since + * you can never concurrently schedule them anyhow. + */ + if (group_leader->cpu != event->cpu) goto err_context; } else { if (group_leader->ctx != ctx) |