diff options
Diffstat (limited to 'include/linux/vmstat.h')
-rw-r--r-- | include/linux/vmstat.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 77caf911969c..7ba91f2839fa 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -19,6 +19,12 @@ | |||
19 | * generated will simply be the increment of a global address. | 19 | * generated will simply be the increment of a global address. |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #ifdef CONFIG_ZONE_DMA | ||
23 | #define DMA_ZONE(xx) xx##_DMA, | ||
24 | #else | ||
25 | #define DMA_ZONE(xx) | ||
26 | #endif | ||
27 | |||
22 | #ifdef CONFIG_ZONE_DMA32 | 28 | #ifdef CONFIG_ZONE_DMA32 |
23 | #define DMA32_ZONE(xx) xx##_DMA32, | 29 | #define DMA32_ZONE(xx) xx##_DMA32, |
24 | #else | 30 | #else |
@@ -31,7 +37,7 @@ | |||
31 | #define HIGHMEM_ZONE(xx) | 37 | #define HIGHMEM_ZONE(xx) |
32 | #endif | 38 | #endif |
33 | 39 | ||
34 | #define FOR_ALL_ZONES(xx) xx##_DMA, DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) | 40 | #define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) |
35 | 41 | ||
36 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | 42 | enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, |
37 | FOR_ALL_ZONES(PGALLOC), | 43 | FOR_ALL_ZONES(PGALLOC), |
@@ -96,7 +102,8 @@ static inline void vm_events_fold_cpu(int cpu) | |||
96 | #endif /* CONFIG_VM_EVENT_COUNTERS */ | 102 | #endif /* CONFIG_VM_EVENT_COUNTERS */ |
97 | 103 | ||
98 | #define __count_zone_vm_events(item, zone, delta) \ | 104 | #define __count_zone_vm_events(item, zone, delta) \ |
99 | __count_vm_events(item##_DMA + zone_idx(zone), delta) | 105 | __count_vm_events(item##_NORMAL - ZONE_NORMAL + \ |
106 | zone_idx(zone), delta) | ||
100 | 107 | ||
101 | /* | 108 | /* |
102 | * Zone based page accounting with per cpu differentials. | 109 | * Zone based page accounting with per cpu differentials. |
@@ -143,14 +150,16 @@ static inline unsigned long node_page_state(int node, | |||
143 | struct zone *zones = NODE_DATA(node)->node_zones; | 150 | struct zone *zones = NODE_DATA(node)->node_zones; |
144 | 151 | ||
145 | return | 152 | return |
153 | #ifdef CONFIG_ZONE_DMA | ||
154 | zone_page_state(&zones[ZONE_DMA], item) + | ||
155 | #endif | ||
146 | #ifdef CONFIG_ZONE_DMA32 | 156 | #ifdef CONFIG_ZONE_DMA32 |
147 | zone_page_state(&zones[ZONE_DMA32], item) + | 157 | zone_page_state(&zones[ZONE_DMA32], item) + |
148 | #endif | 158 | #endif |
149 | zone_page_state(&zones[ZONE_NORMAL], item) + | ||
150 | #ifdef CONFIG_HIGHMEM | 159 | #ifdef CONFIG_HIGHMEM |
151 | zone_page_state(&zones[ZONE_HIGHMEM], item) + | 160 | zone_page_state(&zones[ZONE_HIGHMEM], item) + |
152 | #endif | 161 | #endif |
153 | zone_page_state(&zones[ZONE_DMA], item); | 162 | zone_page_state(&zones[ZONE_NORMAL], item); |
154 | } | 163 | } |
155 | 164 | ||
156 | extern void zone_statistics(struct zonelist *, struct zone *); | 165 | extern void zone_statistics(struct zonelist *, struct zone *); |