Index: linux-2.6.17/include/linux/vmstat.h =================================================================== --- linux-2.6.17.orig/include/linux/vmstat.h 2006-07-03 12:51:19.000000000 -0700 +++ linux-2.6.17/include/linux/vmstat.h 2006-07-03 13:09:06.000000000 -0700 @@ -18,7 +18,17 @@ * generated will simply be the increment of a global address. */ -#define FOR_ALL_ZONES(x) x##_DMA, x##_DMA32, x##_NORMAL, x##_HIGH +#ifdef CONFIG_DMA32 +#define FOR_ALL_LOWER_ZONES(xx) xx##_DMA, xx##_DMA32, xx##_NORMAL +#else +#define FOR_ALL_LOWER_ZONES(xx) xx##_DMA, xx##_NORMAL +#endif + +#ifdef CONFIG_HIGHMEM +#define FOR_ALL_ZONES(xx) FOR_ALL_LOWER_ZONES(xx), xx##_HIGH +#else +#define FOR_ALL_ZONES(xx) FOR_ALL_LOWER_ZONES(xx) +#endif enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, FOR_ALL_ZONES(PGALLOC), Index: linux-2.6.17/mm/vmstat.c =================================================================== --- linux-2.6.17.orig/mm/vmstat.c 2006-07-03 12:53:24.000000000 -0700 +++ linux-2.6.17/mm/vmstat.c 2006-07-03 13:10:32.000000000 -0700 @@ -381,6 +381,18 @@ .show = frag_show, }; +#ifdef CONFIG_ZONE_DMA32 +#define TEXTS_FOR_LOWER_ZONES(xx) xx "_dma", xx "_dma32", xx "_normal" +#else +#define TEXTS_FOR_LOWER_ZONES(xx) xx "_dma", xx "_normal" +#endif + +#ifdef CONFIG_HIGHMEM +#define TEXTS_FOR_ZONES(xx) TEXTS_FOR_LOWER_ZONES(xx), xx "_high" +#else +#define TEXTS_FOR_ZONES(xx) TEXTS_FOR_LOWER_ZONES(xx) +#endif + static char *vmstat_text[] = { /* Zoned VM counters */ "nr_anon_pages", @@ -408,10 +420,7 @@ "pswpin", "pswpout", - "pgalloc_dma", - "pgalloc_dma32", - "pgalloc_normal", - "pgalloc_high", + TEXTS_FOR_ZONES("pgalloc"), "pgfree", "pgactivate", @@ -420,22 +429,13 @@ "pgfault", "pgmajfault", - "pgrefill_dma", - "pgrefill_dma32", - "pgrefill_normal", - "pgrefill_high", - - "pgsteal_dma", - "pgsteal_dma32", - "pgsteal_normal", - "pgsteal_high", - - "pgscan_kswapd_dma", - "pgscan_kswapd_dma32", - "pgscan_kswapd_normal", - "pgscan_kswapd_high", + TEXTS_FOR_ZONES("pgrefill"), + + TEXTS_FOR_ZONES("pgsteal"), + + TEXTS_FOR_ZONES("pgscan_kswapd"), - "pgscan_direct_dma", + TEXTS_FOR_ZONES("pgscan_direct"), "pgscan_direct_dma32", "pgscan_direct_normal", "pgscan_direct_high",