aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMel Gorman <mgorman@suse.de>2014-01-21 17:33:16 -0500
committerIngo Molnar <mingo@kernel.org>2014-01-25 03:10:41 -0500
commitec65993443736a5091b68e80ff1734548944a4b8 (patch)
treea2f9e960f8b9113012118de382ffcda741a1feaf /include
parent2993ae3305ad10b41e0d0bc2662f7754ee8e30fa (diff)
mm, x86: Account for TLB flushes only when debugging
Bisection between 3.11 and 3.12 fingered commit 9824cf97 ("mm: vmstats: tlb flush counters") to cause overhead problems. The counters are undeniably useful but how often do we really need to debug TLB flush related issues? It does not justify taking the penalty everywhere so make it a debugging option. Signed-off-by: Mel Gorman <mgorman@suse.de> Tested-by: Davidlohr Bueso <davidlohr@hp.com> Reviewed-by: Rik van Riel <riel@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Hugh Dickins <hughd@google.com> Cc: Alex Shi <alex.shi@linaro.org> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/n/tip-XzxjntugxuwpxXhcrxqqh53b@git.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/vm_event_item.h4
-rw-r--r--include/linux/vmstat.h8
2 files changed, 11 insertions, 1 deletions
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h
index c557c6d096de..3a712e2e7d76 100644
--- a/include/linux/vm_event_item.h
+++ b/include/linux/vm_event_item.h
@@ -71,12 +71,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
71 THP_ZERO_PAGE_ALLOC, 71 THP_ZERO_PAGE_ALLOC,
72 THP_ZERO_PAGE_ALLOC_FAILED, 72 THP_ZERO_PAGE_ALLOC_FAILED,
73#endif 73#endif
74#ifdef CONFIG_DEBUG_TLBFLUSH
74#ifdef CONFIG_SMP 75#ifdef CONFIG_SMP
75 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */ 76 NR_TLB_REMOTE_FLUSH, /* cpu tried to flush others' tlbs */
76 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */ 77 NR_TLB_REMOTE_FLUSH_RECEIVED,/* cpu received ipi for flush */
77#endif 78#endif /* CONFIG_SMP */
78 NR_TLB_LOCAL_FLUSH_ALL, 79 NR_TLB_LOCAL_FLUSH_ALL,
79 NR_TLB_LOCAL_FLUSH_ONE, 80 NR_TLB_LOCAL_FLUSH_ONE,
81#endif /* CONFIG_DEBUG_TLBFLUSH */
80 NR_VM_EVENT_ITEMS 82 NR_VM_EVENT_ITEMS
81}; 83};
82 84
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index e4b948080d20..80ebba9c2e87 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -83,6 +83,14 @@ static inline void vm_events_fold_cpu(int cpu)
83#define count_vm_numa_events(x, y) do { (void)(y); } while (0) 83#define count_vm_numa_events(x, y) do { (void)(y); } while (0)
84#endif /* CONFIG_NUMA_BALANCING */ 84#endif /* CONFIG_NUMA_BALANCING */
85 85
86#ifdef CONFIG_DEBUG_TLBFLUSH
87#define count_vm_tlb_event(x) count_vm_event(x)
88#define count_vm_tlb_events(x, y) count_vm_events(x, y)
89#else
90#define count_vm_tlb_event(x) do {} while (0)
91#define count_vm_tlb_events(x, y) do { (void)(y); } while (0)
92#endif
93
86#define __count_zone_vm_events(item, zone, delta) \ 94#define __count_zone_vm_events(item, zone, delta) \
87 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ 95 __count_vm_events(item##_NORMAL - ZONE_NORMAL + \
88 zone_idx(zone), delta) 96 zone_idx(zone), delta)