VIRTUAL_MEM_MAP does not need node_mem_map There is no need for a per node mem_map pointer with a virtual memory map. Remove #ifdefs and special casing in alloc_node_mem_map (we can drop the whole function plus the definition of node_mem_map if we decide to no longeri support per node memory maps and instead use always virtual memory maps). Signed-off-by: Christoph Lameter Index: linux-2.6.18-mm3/arch/ia64/mm/discontig.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/discontig.c 2006-10-05 13:29:45.000000000 -0500 +++ linux-2.6.18-mm3/arch/ia64/mm/discontig.c 2006-10-05 17:07:30.645002533 -0500 @@ -708,10 +708,6 @@ void __init paging_init(void) for_each_online_node(node) { num_physpages += mem_data[node].num_physpages; pfn_offset = mem_data[node].min_pfn; - -#ifdef CONFIG_VIRTUAL_MEM_MAP - NODE_DATA(node)->node_mem_map = mem_map + pfn_offset; -#endif if (mem_data[node].max_pfn > max_pfn) max_pfn = mem_data[node].max_pfn; } Index: linux-2.6.18-mm3/include/linux/mmzone.h =================================================================== --- linux-2.6.18-mm3.orig/include/linux/mmzone.h 2006-10-05 13:29:45.000000000 -0500 +++ linux-2.6.18-mm3/include/linux/mmzone.h 2006-10-05 17:08:58.569556550 -0500 @@ -380,7 +380,7 @@ typedef struct pglist_data { struct zone node_zones[MAX_NR_ZONES]; struct zonelist node_zonelists[MAX_NR_ZONES]; int nr_zones; -#ifdef CONFIG_FLAT_NODE_MEM_MAP +#if !defined(CONFIG_VIRTUAL_MEM_MAP) && defined(CONFIG_FLAT_NODE_MEM_MAP) struct page *node_mem_map; #endif struct bootmem_data *bdata; Index: linux-2.6.18-mm3/mm/page_alloc.c =================================================================== --- linux-2.6.18-mm3.orig/mm/page_alloc.c 2006-10-05 13:29:46.000000000 -0500 +++ linux-2.6.18-mm3/mm/page_alloc.c 2006-10-05 13:47:10.000000000 -0500 @@ -2536,30 +2536,28 @@ static void __meminit free_area_init_cor static void __init alloc_node_mem_map(struct pglist_data *pgdat) { +#ifndef CONFIG_VIRTUAL_MEM_MAP /* Skip empty nodes */ if (!pgdat->node_spanned_pages) return; #ifdef CONFIG_FLAT_NODE_MEM_MAP - /* ia64 gets its own node_mem_map, before this, without bootmem */ - if (!pgdat->node_mem_map) { - unsigned long size, start, end; - struct page *map; - - /* - * The zone's endpoints aren't required to be MAX_ORDER - * aligned but the node_mem_map endpoints must be in order - * for the buddy allocator to function correctly. - */ - start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); - end = pgdat->node_start_pfn + pgdat->node_spanned_pages; - end = ALIGN(end, MAX_ORDER_NR_PAGES); - size = (end - start) * sizeof(struct page); - map = alloc_remap(pgdat->node_id, size); - if (!map) - map = alloc_bootmem_node(pgdat, size); - pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); - } + unsigned long size, start, end; + struct page *map; + + /* + * The zone's endpoints aren't required to be MAX_ORDER + * aligned but the node_mem_map endpoints must be in order + * for the buddy allocator to function correctly. + */ + start = pgdat->node_start_pfn & ~(MAX_ORDER_NR_PAGES - 1); + end = pgdat->node_start_pfn + pgdat->node_spanned_pages; + end = ALIGN(end, MAX_ORDER_NR_PAGES); + size = (end - start) * sizeof(struct page); + map = alloc_remap(pgdat->node_id, size); + if (!map) + map = alloc_bootmem_node(pgdat, size); + pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); #ifdef CONFIG_FLATMEM /* * With no DISCONTIG, the global mem_map is just set as node 0's @@ -2573,6 +2571,7 @@ static void __init alloc_node_mem_map(st } #endif #endif /* CONFIG_FLAT_NODE_MEM_MAP */ +#endif /* CONFIG_VIRTUAL_MEM_MAP */ } void __meminit free_area_init_node(int nid, struct pglist_data *pgdat,