diff options
| author | Davidlohr Bueso <davidlohr@hp.com> | 2014-06-04 19:06:46 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:53:57 -0400 |
| commit | 4f115147ff802267d0aa41e361c5aa5bd933d896 (patch) | |
| tree | 27afdf3f60c21fde601df63d9e9998b0c758a3fe /include/linux | |
| parent | 6f04f48dc9c0433e2bb687f5f7f7af1aba97b04d (diff) | |
mm,vmacache: add debug data
Introduce a CONFIG_DEBUG_VM_VMACACHE option to enable counting the cache
hit rate -- exported in /proc/vmstat.
Any updates to the caching scheme needs this kind of data, thus it can
save some work re-implementing the counting all the time.
Signed-off-by: Davidlohr Bueso <davidlohr@hp.com>
Cc: Aswin Chandramouleeswaran <aswin@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/vm_event_item.h | 4 | ||||
| -rw-r--r-- | include/linux/vmstat.h | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/include/linux/vm_event_item.h b/include/linux/vm_event_item.h index 486c3972c0be..ced92345c963 100644 --- a/include/linux/vm_event_item.h +++ b/include/linux/vm_event_item.h | |||
| @@ -80,6 +80,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
| 80 | NR_TLB_LOCAL_FLUSH_ALL, | 80 | NR_TLB_LOCAL_FLUSH_ALL, |
| 81 | NR_TLB_LOCAL_FLUSH_ONE, | 81 | NR_TLB_LOCAL_FLUSH_ONE, |
| 82 | #endif /* CONFIG_DEBUG_TLBFLUSH */ | 82 | #endif /* CONFIG_DEBUG_TLBFLUSH */ |
| 83 | #ifdef CONFIG_DEBUG_VM_VMACACHE | ||
| 84 | VMACACHE_FIND_CALLS, | ||
| 85 | VMACACHE_FIND_HITS, | ||
| 86 | #endif | ||
| 83 | NR_VM_EVENT_ITEMS | 87 | NR_VM_EVENT_ITEMS |
| 84 | }; | 88 | }; |
| 85 | 89 | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 45c9cd1daf7a..82e7db7f7100 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
| @@ -95,6 +95,12 @@ static inline void vm_events_fold_cpu(int cpu) | |||
| 95 | #define count_vm_tlb_events(x, y) do { (void)(y); } while (0) | 95 | #define count_vm_tlb_events(x, y) do { (void)(y); } while (0) |
| 96 | #endif | 96 | #endif |
| 97 | 97 | ||
| 98 | #ifdef CONFIG_DEBUG_VM_VMACACHE | ||
| 99 | #define count_vm_vmacache_event(x) count_vm_event(x) | ||
| 100 | #else | ||
| 101 | #define count_vm_vmacache_event(x) do {} while (0) | ||
| 102 | #endif | ||
| 103 | |||
| 98 | #define __count_zone_vm_events(item, zone, delta) \ | 104 | #define __count_zone_vm_events(item, zone, delta) \ |
| 99 | __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ | 105 | __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ |
| 100 | zone_idx(zone), delta) | 106 | zone_idx(zone), delta) |
