diff options
author | Peter Zijlstra <a.p.zijlstra@chello.nl> | 2009-06-10 16:53:37 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-10 20:39:01 -0400 |
commit | 66fff22483d8542dfb4d61a28d21277bbde321e8 (patch) | |
tree | 615c582da3ef5bb75063467e82e9c63b010b535e /kernel | |
parent | f7b7c26e01e51fe46097e11f179dc71ce7950084 (diff) |
perf_counter: Annotate exit ctx recursion
Ever since Paul fixed it to unclone the context before taking the
ctx->lock this became a false positive, annotate it away.
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-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, |