diff options
-rw-r--r-- | include/linux/vmstat.h | 47 |
1 files changed, 29 insertions, 18 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 7ba91f2839fa..acb1f105870c 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -7,18 +7,6 @@ | |||
7 | #include <linux/mmzone.h> | 7 | #include <linux/mmzone.h> |
8 | #include <asm/atomic.h> | 8 | #include <asm/atomic.h> |
9 | 9 | ||
10 | #ifdef CONFIG_VM_EVENT_COUNTERS | ||
11 | /* | ||
12 | * Light weight per cpu counter implementation. | ||
13 | * | ||
14 | * Counters should only be incremented. You need to set EMBEDDED | ||
15 | * to disable VM_EVENT_COUNTERS. Things like procps (vmstat, | ||
16 | * top, etc) use /proc/vmstat and depend on these counters. | ||
17 | * | ||
18 | * Counters are handled completely inline. On many platforms the code | ||
19 | * generated will simply be the increment of a global address. | ||
20 | */ | ||
21 | |||
22 | #ifdef CONFIG_ZONE_DMA | 10 | #ifdef CONFIG_ZONE_DMA |
23 | #define DMA_ZONE(xx) xx##_DMA, | 11 | #define DMA_ZONE(xx) xx##_DMA, |
24 | #else | 12 | #else |
@@ -52,6 +40,17 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
52 | NR_VM_EVENT_ITEMS | 40 | NR_VM_EVENT_ITEMS |
53 | }; | 41 | }; |
54 | 42 | ||
43 | #ifdef CONFIG_VM_EVENT_COUNTERS | ||
44 | /* | ||
45 | * Light weight per cpu counter implementation. | ||
46 | * | ||
47 | * Counters should only be incremented and no critical kernel component | ||
48 | * should rely on the counter values. | ||
49 | * | ||
50 | * Counters are handled completely inline. On many platforms the code | ||
51 | * generated will simply be the increment of a global address. | ||
52 | */ | ||
53 | |||
55 | struct vm_event_state { | 54 | struct vm_event_state { |
56 | unsigned long event[NR_VM_EVENT_ITEMS]; | 55 | unsigned long event[NR_VM_EVENT_ITEMS]; |
57 | }; | 56 | }; |
@@ -92,12 +91,24 @@ static inline void vm_events_fold_cpu(int cpu) | |||
92 | #else | 91 | #else |
93 | 92 | ||
94 | /* Disable counters */ | 93 | /* Disable counters */ |
95 | #define get_cpu_vm_events(e) 0L | 94 | static inline void count_vm_event(enum vm_event_item item) |
96 | #define count_vm_event(e) do { } while (0) | 95 | { |
97 | #define count_vm_events(e,d) do { } while (0) | 96 | } |
98 | #define __count_vm_event(e) do { } while (0) | 97 | static inline void count_vm_events(enum vm_event_item item, long delta) |
99 | #define __count_vm_events(e,d) do { } while (0) | 98 | { |
100 | #define vm_events_fold_cpu(x) do { } while (0) | 99 | } |
100 | static inline void __count_vm_event(enum vm_event_item item) | ||
101 | { | ||
102 | } | ||
103 | static inline void __count_vm_events(enum vm_event_item item, long delta) | ||
104 | { | ||
105 | } | ||
106 | static inline void all_vm_events(unsigned long *ret) | ||
107 | { | ||
108 | } | ||
109 | static inline void vm_events_fold_cpu(int cpu) | ||
110 | { | ||
111 | } | ||
101 | 112 | ||
102 | #endif /* CONFIG_VM_EVENT_COUNTERS */ | 113 | #endif /* CONFIG_VM_EVENT_COUNTERS */ |
103 | 114 | ||