summaryrefslogtreecommitdiffstats
path: root/kernel/events
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2015-01-28 15:42:56 +0100
committerIngo Molnar <mingo@kernel.org>2015-01-28 15:42:56 +0100
commitf10698ed6807dc41d021fb7baeb24f9bc4051837 (patch)
treefe9229efe38ad31788843a7535bfc3feb89f79a7 /kernel/events
parent86038c5ea81b519a8a1fcfcd5e4599aab0cdd119 (diff)
parente742f3dc0886a92403d578e8ac771e5e33d06d08 (diff)
downloadop-kernel-dev-f10698ed6807dc41d021fb7baeb24f9bc4051837.zip
op-kernel-dev-f10698ed6807dc41d021fb7baeb24f9bc4051837.tar.gz
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.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c
index c10124b..b4a696c 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)
OpenPOWER on IntegriCloud