]> git.baikalelectronics.ru Git - kernel.git/commit
ARM: 7354/1: perf: limit sample_period to half max_period in non-sampling mode
authorWill Deacon <will.deacon@arm.com>
Tue, 6 Mar 2012 16:33:17 +0000 (17:33 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Wed, 7 Mar 2012 09:40:48 +0000 (09:40 +0000)
commit79de457aebba01edc85f691254de85af3e106b03
treeed27e4b37407917d2f9813a4684cceb64f0d6f93
parent07dee164033c24e64823922f53e189bab10c3c77
ARM: 7354/1: perf: limit sample_period to half max_period in non-sampling mode

On ARM, the PMU does not stop counting after an overflow and therefore
IRQ latency affects the new counter value read by the kernel. This is
significant for non-sampling runs where it is possible for the new value
to overtake the previous one, causing the delta to be out by up to
max_period events.

Commit 99605d53 ("ARM: 6835/1: perf: ensure overflows aren't missed due
to IRQ latency") attempted to fix this problem by allowing interrupt
handlers to pass an overflow flag to the event update function, causing
the overflow calculation to assume that the counter passed through zero
when going from prev to new. Unfortunately, this doesn't work when
overflow occurs on the perf_task_tick path because we have the flag
cleared and end up computing a large negative delta.

This patch removes the overflow flag from armpmu_event_update and
instead limits the sample_period to half of the max_period for
non-sampling profiling runs.

Cc: <stable@vger.kernel.org>
Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/pmu.h
arch/arm/kernel/perf_event.c
arch/arm/kernel/perf_event_v6.c
arch/arm/kernel/perf_event_v7.c
arch/arm/kernel/perf_event_xscale.c