diff options
author | Ingo Molnar <mingo@kernel.org> | 2015-02-04 07:53:17 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-02-04 07:53:17 +0100 |
commit | 2622e849a1d3d3ef531d1cc33308bb7fd00eee40 (patch) | |
tree | f2be9d9f08444cb93b3a8f87099fe4ff8ac3cd57 /kernel/events/core.c | |
parent | 996636ddae5cab8883bd76b996cd4f2ea9a152be (diff) | |
parent | e36f014edff70fc02b3d3d79cead1d58f289332e (diff) | |
download | linux-2622e849a1d3d3ef531d1cc33308bb7fd00eee40.tar.bz2 |
Merge tag 'v3.19-rc7' into locking/core, to refresh the branch before applying new changes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events/core.c')
-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 882f835a0d85..19efcf13375a 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6776,7 +6776,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); @@ -7420,7 +7419,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) |