summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2011-03-16 19:04:35 -0400
committerMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>2011-03-16 19:04:35 -0400
commit54e6171895006a006a71fd70183fef1f0375882b (patch)
tree8f30b3cb3ba64a1c5ac2863065f3c623f3d40d73 /mm
parent4298d6b069039c7f8e676f3b7499a00a4426971b (diff)
lttng-instrumentation/lttng-instrumentation-memory
LTTng instrumentation - memory page faults Instrument the page fault entry and exit. Useful to detect delays caused by page faults and bad memory usage patterns. Those tracepoints are used by LTTng. About the performance impact of tracepoints (which is comparable to markers), even without immediate values optimizations, tests done by Hideo Aoki on ia64 show no regression. His test case was using hackbench on a kernel where scheduler instrumentation (about 5 events in code scheduler code) was added. See the "Tracepoints" patch header for performance result detail. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca> CC: Andi Kleen <andi-suse@firstfloor.org> CC: linux-mm@kvack.org CC: Dave Hansen <haveblue@us.ibm.com> CC: Masami Hiramatsu <mhiramat@redhat.com> CC: 'Peter Zijlstra' <peterz@infradead.org> CC: "Frank Ch. Eigler" <fche@redhat.com> CC: 'Ingo Molnar' <mingo@elte.hu> CC: 'Hideo AOKI' <haoki@redhat.com> CC: Takashi Nishiie <t-nishiie@np.css.fujitsu.com> CC: 'Steven Rostedt' <rostedt@goodmis.org> CC: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 17751b386f7..dc955dad52a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -58,6 +58,7 @@
#include <linux/elf.h>
#include <linux/gfp.h>
#include <trace/swap.h>
+#include <trace/fault.h>
#include <asm/io.h>
#include <asm/pgalloc.h>
@@ -69,6 +70,8 @@
#include "internal.h"
DEFINE_TRACE(swap_in);
+DEFINE_TRACE(page_fault_get_user_entry);
+DEFINE_TRACE(page_fault_get_user_exit);
#ifndef CONFIG_NEED_MULTIPLE_NODES
/* use the per-pgdat data instead for discontigmem - mbligh */
@@ -1519,6 +1522,8 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
int ret;
unsigned int fault_flags = 0;
+ trace_page_fault_get_user_entry(mm,
+ vma, start, foll_flags & FOLL_WRITE);
if (foll_flags & FOLL_WRITE)
fault_flags |= FAULT_FLAG_WRITE;
if (nonblocking)
@@ -1526,6 +1531,7 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
ret = handle_mm_fault(mm, vma, start,
fault_flags);
+ trace_page_fault_get_user_exit(ret);
if (ret & VM_FAULT_ERROR) {
if (ret & VM_FAULT_OOM)