perf: Fix PERF_EVENT_IOC_PERIOD deadlock
authorPeter Zijlstra <peterz@infradead.org>
Mon, 30 Nov 2015 11:56:15 +0000 (12:56 +0100)
committerIngo Molnar <mingo@kernel.org>
Fri, 4 Dec 2015 09:08:03 +0000 (10:08 +0100)
commit642c2d671ceff40e9453203ea0c66e991e11e249
treee02c733869c9c66e96f0a99d64bfde200a68ae7e
parent90eec103b96e30401c0b846045bf8a1c7159b6da
perf: Fix PERF_EVENT_IOC_PERIOD deadlock

Dmitry reported a fairly silly recursive lock deadlock for
PERF_EVENT_IOC_PERIOD, fix this by explicitly doing the inactive part of
__perf_event_period() instead of calling that function.

Reported-by: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Cc: Alexander Potapenko <glider@google.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kostya Serebryany <kcc@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Sasha Levin <sasha.levin@oracle.com>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Fixes: c7999c6f3fed ("perf: Fix PERF_EVENT_IOC_PERIOD migration race")
Link: http://lkml.kernel.org/r/20151130115615.GJ17308@twins.programming.kicks-ass.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
kernel/events/core.c