diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2011-04-09 15:17:47 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-05-28 12:01:21 -0400 |
commit | e03a9a55b4e45377af9ca3d464135f9ea280b8f8 (patch) | |
tree | 81ccb92c25baf8c1ac3d181fe25607328c1eb7f1 /kernel/events/core.c | |
parent | dce5855bba5df9e87bb04584d505c1f1b103c652 (diff) |
perf: Change close() semantics for group events
In order to always call list_del_event() on the correct cpu if the
event is part of an active context and avoid having to do two IPIs,
change the close() semantics slightly.
The current perf_event_disable() call would disable a whole group if
the event that's being closed is the group leader, whereas the new
code keeps the group siblings enabled.
People should not rely on this behaviour and I don't think they do,
but in case we find they do, the fix is easy and we have to take the
double IPI cost.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Vince Weaver <vweaver1@eecs.utk.edu>
Link: http://lkml.kernel.org/r/20110409192142.038377551@chello.nl
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/events/core.c')
-rw-r--r-- | kernel/events/core.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 802f3b24eeef..c378062da277 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -2920,12 +2920,6 @@ int perf_event_release_kernel(struct perf_event *event) | |||
2920 | { | 2920 | { |
2921 | struct perf_event_context *ctx = event->ctx; | 2921 | struct perf_event_context *ctx = event->ctx; |
2922 | 2922 | ||
2923 | /* | ||
2924 | * Remove from the PMU, can't get re-enabled since we got | ||
2925 | * here because the last ref went. | ||
2926 | */ | ||
2927 | perf_event_disable(event); | ||
2928 | |||
2929 | WARN_ON_ONCE(ctx->parent_ctx); | 2923 | WARN_ON_ONCE(ctx->parent_ctx); |
2930 | /* | 2924 | /* |
2931 | * There are two ways this annotation is useful: | 2925 | * There are two ways this annotation is useful: |
@@ -2942,8 +2936,8 @@ int perf_event_release_kernel(struct perf_event *event) | |||
2942 | mutex_lock_nested(&ctx->mutex, SINGLE_DEPTH_NESTING); | 2936 | mutex_lock_nested(&ctx->mutex, SINGLE_DEPTH_NESTING); |
2943 | raw_spin_lock_irq(&ctx->lock); | 2937 | raw_spin_lock_irq(&ctx->lock); |
2944 | perf_group_detach(event); | 2938 | perf_group_detach(event); |
2945 | list_del_event(event, ctx); | ||
2946 | raw_spin_unlock_irq(&ctx->lock); | 2939 | raw_spin_unlock_irq(&ctx->lock); |
2940 | perf_remove_from_context(event); | ||
2947 | mutex_unlock(&ctx->mutex); | 2941 | mutex_unlock(&ctx->mutex); |
2948 | 2942 | ||
2949 | free_event(event); | 2943 | free_event(event); |