perf: Fix unclone_ctx() vs. locking
authorPeter Zijlstra <peterz@infradead.org>
Tue, 30 Sep 2014 17:23:08 +0000 (19:23 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 3 Oct 2014 03:41:06 +0000 (05:41 +0200)
commit211de6eba8960521e2be450a7d07db85fba4604c
tree8906de527a99e671d03f6f9fc0b4a11eac892a62
parentfe82dcec644244676d55a1384c958d5f67979adb
perf: Fix unclone_ctx() vs. locking

The idiot who did 4a1c0f262f88 ("perf: Fix lockdep warning on process exit")
forgot to pay attention and fix all similar cases. Do so now.

In particular, unclone_ctx() must be called while holding ctx->lock,
therefore all such sites are broken for the same reason. Pull the
put_ctx() call out from under ctx->lock.

Reported-by: Sasha Levin <sasha.levin@oracle.com>
Probably-also-reported-by: Vince Weaver <vincent.weaver@maine.edu>
Fixes: 4a1c0f262f88 ("perf: Fix lockdep warning on process exit")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Cong Wang <cwang@twopensource.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/20140930172308.GI4241@worktop.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c