diff options
author | Daniel Thompson <daniel.thompson@linaro.org> | 2015-01-05 15:58:54 +0100 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2015-01-12 19:28:46 +0000 |
commit | 2d9ed7406fd24987b75f78fea8290202d8108f34 (patch) | |
tree | 3f4ac106347ac75eae20f929fe4a186002c48a11 /arch/arm/nwfpe | |
parent | a18f36453e0788d2d285a62b85c7c668ec119a64 (diff) |
ARM: 8255/1: perf: Prevent wraparound during overflow
If the overflow threshold for a counter is set above or near the
0xffffffff boundary then the kernel may lose track of the overflow
causing only events that occur *after* the overflow to be recorded.
Specifically the problem occurs when the value of the performance counter
overtakes its original programmed value due to wrap around.
Typical solutions to this problem are either to avoid programming in
values likely to be overtaken or to treat the overflow bit as the 33rd
bit of the counter.
Its somewhat fiddly to refactor the code to correctly handle the 33rd bit
during irqsave sections (context switches for example) so instead we take
the simpler approach of avoiding values likely to be overtaken.
We set the limit to half of max_period because this matches the limit
imposed in __hw_perf_event_init(). This causes a doubling of the interrupt
rate for large threshold values, however even with a very fast counter
ticking at 4GHz the interrupt rate would only be ~1Hz.
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/nwfpe')
0 files changed, 0 insertions, 0 deletions