diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-08-25 05:01:05 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-25 05:01:05 -0400 |
commit | 290d9bf2811bd83ae907232176d75690c0f7d82b (patch) | |
tree | a3b72364248c4bc1b2bf6ed1958ea4e6d6a1564e /kernel/events | |
parent | c7f4f994dea2e6a513e63f063f6c92202b7c1f3f (diff) | |
parent | 64aee2a965cf2954a038b5522f11d2cd2f0f8f3e (diff) |
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 | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index d704e23914bf..1ac5015bab04 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -10041,28 +10041,27 @@ SYSCALL_DEFINE5(perf_event_open, | |||
10041 | goto err_context; | 10041 | goto err_context; |
10042 | 10042 | ||
10043 | /* | 10043 | /* |
10044 | * Do not allow to attach to a group in a different | 10044 | * Make sure we're both events for the same CPU; |
10045 | * task or CPU context: | 10045 | * grouping events for different CPUs is broken; since |
10046 | * you can never concurrently schedule them anyhow. | ||
10046 | */ | 10047 | */ |
10047 | if (move_group) { | 10048 | if (group_leader->cpu != event->cpu) |
10048 | /* | 10049 | goto err_context; |
10049 | * Make sure we're both on the same task, or both | ||
10050 | * per-cpu events. | ||
10051 | */ | ||
10052 | if (group_leader->ctx->task != ctx->task) | ||
10053 | goto err_context; | ||
10054 | 10050 | ||
10055 | /* | 10051 | /* |
10056 | * Make sure we're both events for the same CPU; | 10052 | * Make sure we're both on the same task, or both |
10057 | * grouping events for different CPUs is broken; since | 10053 | * per-CPU events. |
10058 | * you can never concurrently schedule them anyhow. | 10054 | */ |
10059 | */ | 10055 | if (group_leader->ctx->task != ctx->task) |
10060 | if (group_leader->cpu != event->cpu) | 10056 | goto err_context; |
10061 | goto err_context; | 10057 | |
10062 | } else { | 10058 | /* |
10063 | if (group_leader->ctx != ctx) | 10059 | * Do not allow to attach to a group in a different task |
10064 | goto err_context; | 10060 | * or CPU context. If we're moving SW events, we'll fix |
10065 | } | 10061 | * this up later, so allow that. |
10062 | */ | ||
10063 | if (!move_group && group_leader->ctx != ctx) | ||
10064 | goto err_context; | ||
10066 | 10065 | ||
10067 | /* | 10066 | /* |
10068 | * Only a group leader can be exclusive or pinned | 10067 | * Only a group leader can be exclusive or pinned |