diff options
-rw-r--r-- | kernel/perf_counter.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c index 51c571ee4d0b..ae591a1275a6 100644 --- a/kernel/perf_counter.c +++ b/kernel/perf_counter.c | |||
@@ -3879,7 +3879,18 @@ void perf_counter_exit_task(struct task_struct *child) | |||
3879 | spin_unlock(&child_ctx->lock); | 3879 | spin_unlock(&child_ctx->lock); |
3880 | local_irq_restore(flags); | 3880 | local_irq_restore(flags); |
3881 | 3881 | ||
3882 | mutex_lock(&child_ctx->mutex); | 3882 | /* |
3883 | * We can recurse on the same lock type through: | ||
3884 | * | ||
3885 | * __perf_counter_exit_task() | ||
3886 | * sync_child_counter() | ||
3887 | * fput(parent_counter->filp) | ||
3888 | * perf_release() | ||
3889 | * mutex_lock(&ctx->mutex) | ||
3890 | * | ||
3891 | * But since its the parent context it won't be the same instance. | ||
3892 | */ | ||
3893 | mutex_lock_nested(&child_ctx->mutex, SINGLE_DEPTH_NESTING); | ||
3883 | 3894 | ||
3884 | again: | 3895 | again: |
3885 | list_for_each_entry_safe(child_counter, tmp, &child_ctx->counter_list, | 3896 | list_for_each_entry_safe(child_counter, tmp, &child_ctx->counter_list, |