aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDave Hansen <dave@sr71.net>2014-07-31 11:40:59 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2014-07-31 11:48:51 -0400
commitd17d8f9dedb9dd76fd540a5c497101529d9eb25a (patch)
tree9419fa5866856e22eb1fc26202085904556f346c /include
parenta23421f111bb256cdbf23dcfe15f35567ab88e98 (diff)
x86/mm: Add tracepoints for TLB flushes
We don't have any good way to figure out what kinds of flushes are being attempted. Right now, we can try to use the vm counters, but those only tell us what we actually did with the hardware (one-by-one vs full) and don't tell us what was actually _requested_. This allows us to select out "interesting" TLB flushes that we might want to optimize (like the ranged ones) and ignore the ones that we have very little control over (the ones at context switch). Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Link: http://lkml.kernel.org/r/20140731154059.4C96CBA5@viggo.jf.intel.com Acked-by: Rik van Riel <riel@redhat.com> Cc: Mel Gorman <mgorman@suse.de> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/mm_types.h8
-rw-r--r--include/trace/events/tlb.h40
2 files changed, 48 insertions, 0 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 96c5750e3110..796deac19fcf 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -516,4 +516,12 @@ struct vm_special_mapping
516 struct page **pages; 516 struct page **pages;
517}; 517};
518 518
519enum tlb_flush_reason {
520 TLB_FLUSH_ON_TASK_SWITCH,
521 TLB_REMOTE_SHOOTDOWN,
522 TLB_LOCAL_SHOOTDOWN,
523 TLB_LOCAL_MM_SHOOTDOWN,
524 NR_TLB_FLUSH_REASONS,
525};
526
519#endif /* _LINUX_MM_TYPES_H */ 527#endif /* _LINUX_MM_TYPES_H */
diff --git a/include/trace/events/tlb.h b/include/trace/events/tlb.h
new file mode 100644
index 000000000000..13391d288107
--- /dev/null
+++ b/include/trace/events/tlb.h
@@ -0,0 +1,40 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM tlb
3
4#if !defined(_TRACE_TLB_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_TLB_H
6
7#include <linux/mm_types.h>
8#include <linux/tracepoint.h>
9
10#define TLB_FLUSH_REASON \
11 { TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" }, \
12 { TLB_REMOTE_SHOOTDOWN, "remote shootdown" }, \
13 { TLB_LOCAL_SHOOTDOWN, "local shootdown" }, \
14 { TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" }
15
16TRACE_EVENT(tlb_flush,
17
18 TP_PROTO(int reason, unsigned long pages),
19 TP_ARGS(reason, pages),
20
21 TP_STRUCT__entry(
22 __field( int, reason)
23 __field(unsigned long, pages)
24 ),
25
26 TP_fast_assign(
27 __entry->reason = reason;
28 __entry->pages = pages;
29 ),
30
31 TP_printk("pages:%ld reason:%s (%d)",
32 __entry->pages,
33 __print_symbolic(__entry->reason, TLB_FLUSH_REASON),
34 __entry->reason)
35);
36
37#endif /* _TRACE_TLB_H */
38
39/* This part must be outside protection */
40#include <trace/define_trace.h>