Index: linux-2.6.18-rc5-mm1/include/linux/mmzone.h =================================================================== --- linux-2.6.18-rc5-mm1.orig/include/linux/mmzone.h 2006-09-02 21:48:11.000000000 -0700 +++ linux-2.6.18-rc5-mm1/include/linux/mmzone.h 2006-09-03 14:41:08.000000000 -0700 @@ -159,7 +159,7 @@ #define ZONES_SHIFT 2 #endif -#ifdef SINGLE_ZONE +#ifndef SINGLE_ZONE #define MULTI_ZONE #endif @@ -221,8 +221,10 @@ /* A count of how many reclaimers are scanning this zone */ atomic_t reclaim_in_progress; +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) /* Zone statistics */ atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS]; +#endif /* * prev_priority holds the scanning priority for this zone. It is Index: linux-2.6.18-rc5-mm1/include/linux/vmstat.h =================================================================== --- linux-2.6.18-rc5-mm1.orig/include/linux/vmstat.h 2006-09-02 21:48:05.000000000 -0700 +++ linux-2.6.18-rc5-mm1/include/linux/vmstat.h 2006-09-02 21:48:12.000000000 -0700 @@ -108,7 +108,9 @@ static inline void zone_page_state_add(long x, struct zone *zone, enum zone_stat_item item) { +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) atomic_long_add(x, &zone->vm_stat[item]); +#endif atomic_long_add(x, &vm_stat[item]); } @@ -125,11 +127,17 @@ static inline unsigned long zone_page_state(struct zone *zone, enum zone_stat_item item) { - long x = atomic_long_read(&zone->vm_stat[item]); + long x; + +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) + x = atomic_long_read(&zone->vm_stat[item]); #ifdef CONFIG_SMP if (x < 0) x = 0; #endif +#else + x = atomic_long_read(&vm_stat[item]); +#endif return x; } @@ -176,7 +184,9 @@ static inline void zap_zone_vm_stats(struct zone *zone) { +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) memset(zone->vm_stat, 0, sizeof(zone->vm_stat)); +#endif } extern void inc_zone_state(struct zone *, enum zone_stat_item); @@ -209,7 +219,9 @@ static inline void __inc_zone_state(struct zone *zone, enum zone_stat_item item) { +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) atomic_long_inc(&zone->vm_stat[item]); +#endif atomic_long_inc(&vm_stat[item]); } @@ -222,7 +234,9 @@ static inline void __dec_zone_page_state(struct page *page, enum zone_stat_item item) { +#if defined(CONFIG_NUMA) || defined(MULTI_ZONE) atomic_long_dec(&page_zone(page)->vm_stat[item]); +#endif atomic_long_dec(&vm_stat[item]); }