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 18:16:20.000000000 -0500 +++ linux-2.6.18-rc6-mm1/include/linux/mm.h 2006-09-11 18:25:24.885737568 -0500 @@ -451,12 +451,6 @@ #define NODES_PGOFF (SECTIONS_PGOFF - NODES_WIDTH) #define ZONES_PGOFF (NODES_PGOFF - ZONES_WIDTH) -/* - * We are going to use the flags for the page to node mapping if its in - * there. This includes the case where there is no node, so it is implicit. - */ -#define FLAGS_HAS_NODE (NODES_WIDTH > 0 || NODES_SHIFT == 0) - #ifndef PFN_SECTION_SHIFT #define PFN_SECTION_SHIFT 0 #endif @@ -470,14 +464,6 @@ #define NODES_PGSHIFT (NODES_PGOFF * (NODES_WIDTH != 0)) #define ZONES_PGSHIFT (ZONES_PGOFF * (ZONES_WIDTH != 0)) -/* NODE:ZONE or SECTION:ZONE is used to lookup the zone from a page. */ -#if FLAGS_HAS_NODE -#define ZONETABLE_SHIFT (NODES_SHIFT + ZONES_SHIFT) -#else -#define ZONETABLE_SHIFT (SECTIONS_SHIFT + ZONES_SHIFT) -#endif -#define ZONETABLE_PGSHIFT ZONES_PGSHIFT - #if SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED #error SECTIONS_WIDTH+NODES_WIDTH+ZONES_WIDTH > FLAGS_RESERVED #endif @@ -485,23 +471,20 @@ #define ZONES_MASK ((1UL << ZONES_WIDTH) - 1) #define NODES_MASK ((1UL << NODES_WIDTH) - 1) #define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) -#define ZONETABLE_MASK ((1UL << ZONETABLE_SHIFT) - 1) static inline enum zone_type page_zonenum(struct page *page) { return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; } -struct zone; -extern struct zone *zone_table[]; - -static inline int page_zone_id(struct page *page) +static inline unsigned long page_to_nid(struct page *page) { - return (page->flags >> ZONETABLE_PGSHIFT) & ZONETABLE_MASK; + return (page->flags >> NODES_PGSHIFT) & NODES_MASK; } + static inline struct zone *page_zone(struct page *page) { - return zone_table[page_zone_id(page)]; + return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; } static inline unsigned long zone_to_nid(struct zone *zone) @@ -509,13 +492,6 @@ return zone->zone_pgdat->node_id; } -static inline unsigned long page_to_nid(struct page *page) -{ - if (FLAGS_HAS_NODE) - return (page->flags >> NODES_PGSHIFT) & NODES_MASK; - else - return zone_to_nid(page_zone(page)); -} static inline unsigned long page_to_section(struct page *page) { return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; @@ -1037,8 +1013,8 @@ extern void show_mem(void); extern void si_meminfo(struct sysinfo * val); extern void si_meminfo_node(struct sysinfo *val, int nid); -extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid, - unsigned long pfn, unsigned long size); +static inline void zonetable_add(struct zone *zone, int nid, + enum zone_type zid, unsigned long pfn, unsigned long size) {} #ifdef CONFIG_NUMA extern void setup_per_cpu_pageset(void); 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 18:16:20.000000000 -0500 +++ linux-2.6.18-rc6-mm1/mm/page_alloc.c 2006-09-11 18:22:10.434675322 -0500 @@ -82,13 +82,6 @@ EXPORT_SYMBOL(totalram_pages); -/* - * Used by page_zone() to look up the address of the struct zone whose - * id is encoded in the upper bits of page->flags - */ -struct zone *zone_table[1 << ZONETABLE_SHIFT] __read_mostly; -EXPORT_SYMBOL(zone_table); - static char *zone_names[MAX_NR_ZONES] = { "DMA", #ifdef CONFIG_ZONE_DMA32 @@ -367,7 +360,7 @@ return 0; #endif - if (page_zone_id(page) != page_zone_id(buddy)) + if (page_zone(page) != page_zone(buddy)) return 0; if (PageBuddy(buddy) && page_order(buddy) == order) { @@ -1808,20 +1801,6 @@ } } -#define ZONETABLE_INDEX(x, zone_nr) ((x << ZONES_SHIFT) | zone_nr) -void zonetable_add(struct zone *zone, int nid, enum zone_type zid, - unsigned long pfn, unsigned long size) -{ - unsigned long snum = pfn_to_section_nr(pfn); - unsigned long end = pfn_to_section_nr(pfn + size); - - if (FLAGS_HAS_NODE) - zone_table[ZONETABLE_INDEX(nid, zid)] = zone; - else - for (; snum <= end; snum++) - zone_table[ZONETABLE_INDEX(snum, zid)] = zone; -} - #ifndef __HAVE_ARCH_MEMMAP_INIT #define memmap_init(size, nid, zone, start_pfn) \ memmap_init_zone((size), (nid), (zone), (start_pfn))