]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | From: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> |
2 | Subject: LTTng instrumentation - filemap | |
3 | ||
4 | Original patch header: | |
5 | LTTng instrumentation - filemap | |
6 | ||
7 | Instrumentation of waits caused by memory accesses on mmap regions. | |
8 | ||
9 | Those tracepoints are used by LTTng. | |
10 | ||
11 | About the performance impact of tracepoints (which is comparable to markers), | |
12 | even without immediate values optimizations, tests done by Hideo Aoki on ia64 | |
13 | show no regression. His test case was using hackbench on a kernel where | |
14 | scheduler instrumentation (about 5 events in code scheduler code) was added. | |
15 | See the "Tracepoints" patch header for performance result detail. | |
16 | ||
17 | Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> | |
18 | CC: linux-mm@kvack.org | |
19 | CC: Dave Hansen <haveblue@us.ibm.com> | |
20 | CC: Masami Hiramatsu <mhiramat@redhat.com> | |
21 | CC: 'Peter Zijlstra' <peterz@infradead.org> | |
22 | CC: "Frank Ch. Eigler" <fche@redhat.com> | |
23 | CC: 'Ingo Molnar' <mingo@elte.hu> | |
24 | CC: 'Hideo AOKI' <haoki@redhat.com> | |
25 | CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com> | |
26 | CC: 'Steven Rostedt' <rostedt@goodmis.org> | |
27 | CC: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> | |
28 | ||
29 | Acked-by: Jan Blunck <jblunck@suse.de> | |
30 | --- | |
31 | include/trace/filemap.h | 13 +++++++++++++ | |
32 | mm/filemap.c | 3 +++ | |
33 | 2 files changed, 16 insertions(+) | |
34 | ||
35 | --- /dev/null | |
36 | +++ b/include/trace/filemap.h | |
37 | @@ -0,0 +1,13 @@ | |
38 | +#ifndef _TRACE_FILEMAP_H | |
39 | +#define _TRACE_FILEMAP_H | |
40 | + | |
41 | +#include <linux/tracepoint.h> | |
42 | + | |
43 | +DEFINE_TRACE(wait_on_page_start, | |
44 | + TPPROTO(struct page *page, int bit_nr), | |
45 | + TPARGS(page, bit_nr)); | |
46 | +DEFINE_TRACE(wait_on_page_end, | |
47 | + TPPROTO(struct page *page, int bit_nr), | |
48 | + TPARGS(page, bit_nr)); | |
49 | + | |
50 | +#endif | |
51 | --- a/mm/filemap.c | |
52 | +++ b/mm/filemap.c | |
53 | @@ -34,6 +34,7 @@ | |
54 | #include <linux/hardirq.h> /* for BUG_ON(!in_atomic()) only */ | |
55 | #include <linux/memcontrol.h> | |
56 | #include "internal.h" | |
57 | +#include <trace/filemap.h> | |
58 | ||
59 | /* | |
60 | * FIXME: remove all knowledge of the buffer layer from the core VM | |
61 | @@ -540,9 +541,11 @@ void wait_on_page_bit(struct page *page, | |
62 | { | |
63 | DEFINE_WAIT_BIT(wait, &page->flags, bit_nr); | |
64 | ||
65 | + trace_wait_on_page_start(page, bit_nr); | |
66 | if (test_bit(bit_nr, &page->flags)) | |
67 | __wait_on_bit(page_waitqueue(page), &wait, sync_page, | |
68 | TASK_UNINTERRUPTIBLE); | |
69 | + trace_wait_on_page_end(page, bit_nr); | |
70 | } | |
71 | EXPORT_SYMBOL(wait_on_page_bit); | |
72 |