diff options
author | Peter Zijlstra <peterz@infradead.org> | 2014-05-05 06:42:29 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-05-07 07:44:19 -0400 |
commit | 3a497f48637e2aac17eabb84a17f8ac5216028fc (patch) | |
tree | 9bbebe9cfd32e99b07f5924f7946d8dbe7c547a0 /kernel/events | |
parent | 683ede43dd412c6cad0d23578a018409ac9c683e (diff) |
perf: Simplify perf_event_exit_task_context()
Instead of jumping through hoops to make sure to find (and exit) each
event, do it the simple straight fwd way.
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-tij931199thfkys8vbnokdpf@git.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'kernel/events')
-rw-r--r-- | kernel/events/core.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 83505a35afba..7ab734fbaeeb 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -7485,24 +7485,9 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn) | |||
7485 | */ | 7485 | */ |
7486 | mutex_lock(&child_ctx->mutex); | 7486 | mutex_lock(&child_ctx->mutex); |
7487 | 7487 | ||
7488 | again: | 7488 | list_for_each_entry_rcu(child_event, &child_ctx->event_list, event_entry) |
7489 | list_for_each_entry_safe(child_event, tmp, &child_ctx->pinned_groups, | ||
7490 | group_entry) | ||
7491 | __perf_event_exit_task(child_event, child_ctx, child); | ||
7492 | |||
7493 | list_for_each_entry_safe(child_event, tmp, &child_ctx->flexible_groups, | ||
7494 | group_entry) | ||
7495 | __perf_event_exit_task(child_event, child_ctx, child); | 7489 | __perf_event_exit_task(child_event, child_ctx, child); |
7496 | 7490 | ||
7497 | /* | ||
7498 | * If the last event was a group event, it will have appended all | ||
7499 | * its siblings to the list, but we obtained 'tmp' before that which | ||
7500 | * will still point to the list head terminating the iteration. | ||
7501 | */ | ||
7502 | if (!list_empty(&child_ctx->pinned_groups) || | ||
7503 | !list_empty(&child_ctx->flexible_groups)) | ||
7504 | goto again; | ||
7505 | |||
7506 | mutex_unlock(&child_ctx->mutex); | 7491 | mutex_unlock(&child_ctx->mutex); |
7507 | 7492 | ||
7508 | put_ctx(child_ctx); | 7493 | put_ctx(child_ctx); |