aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/vmstat.h
diff options
context:
space:
mode:
authorChristoph Lameter <clameter@sgi.com>2007-02-10 04:43:10 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-02-11 13:51:18 -0500
commit4b51d66989218aad731a721b5b28c79bf5388c09 (patch)
tree8ff7acbd219f699c20c2f1fd201ffb3db5a64062 /include/linux/vmstat.h
parent66701b1499a3ff11882c8c4aef36e8eac86e17b1 (diff)
[PATCH] optional ZONE_DMA: optional ZONE_DMA in the VM
Make ZONE_DMA optional in core code. - ifdef all code for ZONE_DMA and related definitions following the example for ZONE_DMA32 and ZONE_HIGHMEM. - Without ZONE_DMA, ZONE_HIGHMEM and ZONE_DMA32 we get to a ZONES_SHIFT of 0. - Modify the VM statistics to work correctly without a DMA zone. - Modify slab to not create DMA slabs if there is no ZONE_DMA. [akpm@osdl.org: cleanup] [jdike@addtoit.com: build fix] [apw@shadowen.org: Simplify calculation of the number of bits we need for ZONES_SHIFT] Signed-off-by: Christoph Lameter <clameter@sgi.com> Cc: Andi Kleen <ak@suse.de> Cc: "Luck, Tony" <tony.luck@intel.com> Cc: Kyle McMartin <kyle@mcmartin.ca> Cc: Matthew Wilcox <willy@debian.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Cc: Paul Mundt <lethal@linux-sh.org> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/vmstat.h')
-rw-r--r--include/linux/vmstat.h17
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
36enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, 42enum 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
156extern void zone_statistics(struct zonelist *, struct zone *); 165extern void zone_statistics(struct zonelist *, struct zone *);