Index: linux-2.6.18-rc6-mm1/include/linux/mm.h =================================================================== --- linux-2.6.18-rc6-mm1.orig/include/linux/mm.h 2006-09-11 17:34:57.000000000 -0500 +++ linux-2.6.18-rc6-mm1/include/linux/mm.h 2006-09-11 18:03:47.086235115 -0500 @@ -492,18 +492,26 @@ return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; } +#ifdef MULTIZONE struct zone; extern struct zone *zone_table[]; +#endif static inline int page_zone_id(struct page *page) { return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK; } + static inline struct zone *page_zone(struct page *page) { +#ifdef MULTIZONE return zone_table[page_zone_id(page)]; +#else + return &NODE_DATA((page->flags >> NODES_PGSHIFT) & NODES_MASK)->node_zones[0]; +#endif } + static inline unsigned long zone_to_nid(struct zone *zone) { return get_pgdat(zone)->node_id; Index: linux-2.6.18-rc6-mm1/mm/page_alloc.c =================================================================== --- linux-2.6.18-rc6-mm1.orig/mm/page_alloc.c 2006-09-11 17:34:57.000000000 -0500 +++ linux-2.6.18-rc6-mm1/mm/page_alloc.c 2006-09-11 17:54:15.564148758 -0500 @@ -90,8 +90,10 @@ * Used by page_zone() to look up the address of the struct zone whose * id is encoded in the upper bits of page->flags */ +#ifdef MULTIZONE struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; EXPORT_SYMBOL(zone_table); +#endif static char *zone_names[MAX_NR_ZONES] = { #ifdef CONFIG_ZONE_DMA @@ -1823,6 +1825,7 @@ void zonetable_add(struct zone *zone, int nid, enum zone_type zid, unsigned long pfn, unsigned long size) { +#ifdef MULTIZONE unsigned long snum = pfn_to_section_nr(pfn); unsigned long end = pfn_to_section_nr(pfn + size); @@ -1831,6 +1834,7 @@ else for (; snum <= end; snum++) zone_table[ZONETABLE_INDEX(snum, zid)] = zone; +#endif } #ifndef __HAVE_ARCH_MEMMAP_INIT