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 <[email protected]>
---
kernel/perf_event.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a69d4ed..e8ec4b7 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -2315,7 +2315,7 @@ perf_mmap_data_init(struct perf_event *event, struct
perf_mmap_data *data)
}
if (!data->watermark)
- data->watermark = max_t(long, PAGE_SIZE, max_size / 2);
+ data->watermark = max_size / 2;
rcu_assign_pointer(event->data, data);
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
perfmon2-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/perfmon2-devel