perf: Annotate perf_event_read_group() vs perf_event_release_kernel()
authorPeter Zijlstra <a.p.zijlstra@chello.nl>
Thu, 6 May 2010 13:42:53 +0000 (15:42 +0200)
committerIngo Molnar <mingo@elte.hu>
Fri, 7 May 2010 09:30:59 +0000 (11:30 +0200)
Stephane reported a lockdep warning while using PERF_FORMAT_GROUP.

The issue is that perf_event_read_group() takes faults while holding
the ctx->mutex, while perf_event_release_kernel() can be called from
munmap(). Which makes for an AB-BA deadlock.

Except we can never establish the deadlock because we'll only ever
call perf_event_release_kernel() after all file descriptors are dead
so there is no concurrency possible.

Reported-by: Stephane Eranian <eranian@google.com>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <new-submission>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

No differences found