kernel-ark/kernel/events
Stephane Eranian 9e6302056f perf: Use hrtimers for event multiplexing
The current scheme of using the timer tick was fine for per-thread
events. However, it was causing bias issues in system-wide mode
(including for uncore PMUs). Event groups would not get their fair
share of runtime on the PMU. With tickless kernels, if a core is idle
there is no timer tick, and thus no event rotation (multiplexing).
However, there are events (especially uncore events) which do count
even though cores are asleep.

This patch changes the timer source for multiplexing.  It introduces a
per-PMU per-cpu hrtimer. The advantage is that even when a core goes
idle, it will come back to service the hrtimer, thus multiplexing on
system-wide events works much better.

The per-PMU implementation (suggested by PeterZ) enables adjusting the
multiplexing interval per PMU. The preferred interval is stashed into
the struct pmu. If not set, it will be forced to the default interval
value.

In order to minimize the impact of the hrtimer, it is turned on and
off on demand. When the PMU on a CPU is overcommited, the hrtimer is
activated.  It is stopped when the PMU is not overcommitted.

In order for this to work properly, we had to change the order of
initialization in start_kernel() such that hrtimer_init() is run
before perf_event_init().

The default interval in milliseconds is set to a timer tick just like
with the old code. We will provide a sysctl to tune this in another
patch.

Signed-off-by: Stephane Eranian <eranian@google.com>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Link: http://lkml.kernel.org/r/1364991694-5876-2-git-send-email-eranian@google.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2013-05-28 09:07:10 +02:00
..
callchain.c perf: Add attribute to filter out callchains 2012-08-10 12:40:57 -03:00
core.c perf: Use hrtimers for event multiplexing 2013-05-28 09:07:10 +02:00
hw_breakpoint.c perf: Fix hw breakpoints overflow period sampling 2013-05-28 08:59:54 +02:00
internal.h perf: Fix ring_buffer perf_output_space() boundary calculation 2013-03-21 12:04:35 +01:00
Makefile uprobes: Move to kernel/events/ 2012-02-22 11:08:00 +01:00
ring_buffer.c perf: Fix vmalloc ring buffer pages handling 2013-05-01 12:34:46 +02:00
uprobes.c uretprobes: Remove -ENOSYS as return probes implemented 2013-04-13 15:31:58 +02:00