linux/kernel/events
Alexander Shishkin 927a557085 perf/core: Fix perf_sched_count derailment
The error path in perf_event_open() is such that asking for a sampling
event on a PMU that doesn't generate interrupts will end up in dropping
the perf_sched_count even though it hasn't been incremented for this
event yet.

Given a sufficient amount of these calls, we'll end up disabling
scheduler's jump label even though we'd still have active events in the
system, thereby facilitating the arrival of the infernal regions upon us.

I'm fixing this by moving account_event() inside perf_event_alloc().

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: <stable@vger.kernel.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Cc: vince@deater.net
Link: http://lkml.kernel.org/r/1456917854-29427-1-git-send-email-alexander.shishkin@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-03-08 12:18:31 +01:00
..
Makefile ftrace: allow architectures to specify ftrace compile options 2015-01-29 09:19:19 +01:00
callchain.c treewide: Remove old email address 2015-11-23 09:44:58 +01:00
core.c perf/core: Fix perf_sched_count derailment 2016-03-08 12:18:31 +01:00
hw_breakpoint.c perf: Collapse and fix event_function_call() users 2016-01-21 18:54:24 +01:00
internal.h perf: Fix AUX buffer refcounting 2015-07-06 14:08:30 +02:00
ring_buffer.c perf: Synchronously free aux pages in case of allocation failure 2016-01-21 18:54:27 +01:00
uprobes.c memcg: adjust to support new THP refcounting 2016-01-15 17:56:32 -08:00