]> git.baikalelectronics.ru Git - kernel.git/commit
perf_events: Fix default watermark calculation
authorStephane Eranian <eranian@gmail.com>
Fri, 20 Nov 2009 21:19:57 +0000 (22:19 +0100)
committerIngo Molnar <mingo@elte.hu>
Sat, 21 Nov 2009 13:11:41 +0000 (14:11 +0100)
commitc2a54ff2cd4981a2a648e4481a0861741b39aba1
treec0a23af5059b60f3dd565e2a2a88c8737979588f
parent1bf9e6ca29013bc0505e461c657571a898ec8a13
perf_events: Fix default watermark calculation

This patch fixes the default watermark value for the sampling
buffer. With the existing calculation (watermark =
max(PAGE_SIZE, max_size / 2)), no notification was ever received
when the buffer was exactly 1 page. This was because you would
never cross the threshold (there is no partial samples).

In certain configuration, there was no possibilty detecting the
problem because there was not enough space left to store the
LOST record.In fact, there may be a more generic problem here.
The kernel should ensure that there is alaways enough space to
store one LOST record.

This patch sets the default watermark to half the buffer size.
With such limit, we are guaranteed to get a notification even
with a single page buffer assuming no sample is bigger than a
page.

Signed-off-by: Stephane Eranian <eranian@gmail.com>
Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Paul Mackerras <paulus@samba.org>
LKML-Reference: <20091120212509.344964101@chello.nl>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
LKML-Reference: <1256302576-6169-1-git-send-email-eranian@gmail.com>
kernel/perf_event.c