diff options
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/events/core.c | 22 |
1 files changed, 1 insertions, 21 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 98c862aff8fa..f1e53e8d4ae2 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
| @@ -3758,19 +3758,7 @@ int perf_event_release_kernel(struct perf_event *event) | |||
| 3758 | if (!is_kernel_event(event)) | 3758 | if (!is_kernel_event(event)) |
| 3759 | perf_remove_from_owner(event); | 3759 | perf_remove_from_owner(event); |
| 3760 | 3760 | ||
| 3761 | /* | 3761 | ctx = perf_event_ctx_lock(event); |
| 3762 | * There are two ways this annotation is useful: | ||
| 3763 | * | ||
| 3764 | * 1) there is a lock recursion from perf_event_exit_task | ||
| 3765 | * see the comment there. | ||
| 3766 | * | ||
| 3767 | * 2) there is a lock-inversion with mmap_sem through | ||
| 3768 | * perf_read_group(), which takes faults while | ||
| 3769 | * holding ctx->mutex, however this is called after | ||
| 3770 | * the last filedesc died, so there is no possibility | ||
| 3771 | * to trigger the AB-BA case. | ||
| 3772 | */ | ||
| 3773 | ctx = perf_event_ctx_lock_nested(event, SINGLE_DEPTH_NESTING); | ||
| 3774 | WARN_ON_ONCE(ctx->parent_ctx); | 3762 | WARN_ON_ONCE(ctx->parent_ctx); |
| 3775 | perf_remove_from_context(event, DETACH_GROUP | DETACH_STATE); | 3763 | perf_remove_from_context(event, DETACH_GROUP | DETACH_STATE); |
| 3776 | perf_event_ctx_unlock(event, ctx); | 3764 | perf_event_ctx_unlock(event, ctx); |
| @@ -8759,14 +8747,6 @@ static void perf_event_exit_task_context(struct task_struct *child, int ctxn) | |||
| 8759 | * perf_event_create_kernel_count() which does find_get_context() | 8747 | * perf_event_create_kernel_count() which does find_get_context() |
| 8760 | * without ctx::mutex (it cannot because of the move_group double mutex | 8748 | * without ctx::mutex (it cannot because of the move_group double mutex |
| 8761 | * lock thing). See the comments in perf_install_in_context(). | 8749 | * lock thing). See the comments in perf_install_in_context(). |
| 8762 | * | ||
| 8763 | * We can recurse on the same lock type through: | ||
| 8764 | * | ||
| 8765 | * perf_event_exit_event() | ||
| 8766 | * put_event() | ||
| 8767 | * mutex_lock(&ctx->mutex) | ||
| 8768 | * | ||
| 8769 | * But since its the parent context it won't be the same instance. | ||
| 8770 | */ | 8750 | */ |
| 8771 | mutex_lock(&child_ctx->mutex); | 8751 | mutex_lock(&child_ctx->mutex); |
| 8772 | 8752 | ||
