IA64: Use mem_map instead of vmem_map for VIRTUAL_MEM_MAP IA64 uses vmem_map instead of mem_map. However, both are pointers to struct page. Make IA64 use mem_map instead and rely on the definition in memory.c Signed-off-by: Christoph Lameter Index: linux-2.6.18-mm3/arch/ia64/mm/contig.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/contig.c 2006-10-04 21:04:54.000000000 -0700 +++ linux-2.6.18-mm3/arch/ia64/mm/contig.c 2006-10-04 21:11:55.000000000 -0700 @@ -242,7 +242,7 @@ efi_memmap_walk(register_active_ranges, &nid); efi_memmap_walk(find_largest_hole, (u64 *)&max_gap); if (max_gap < LARGE_GAP) { - vmem_map = (struct page *) 0; + mem_map = (struct page *) 0; free_area_init_nodes(max_zone_pfns); } else { unsigned long map_size; @@ -252,14 +252,14 @@ map_size = PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) * sizeof(struct page)); vmalloc_end -= map_size; - vmem_map = (struct page *) vmalloc_end; + mem_map = (struct page *) vmalloc_end; efi_memmap_walk(create_mem_map_page_table, NULL); /* * alloc_node_mem_map makes an adjustment for mem_map - * which isn't compatible with vmem_map. + * which isn't compatible with mem_map. */ - NODE_DATA(0)->node_mem_map = vmem_map + + NODE_DATA(0)->node_mem_map = mem_map + find_min_pfn_with_active_regions(); free_area_init_nodes(max_zone_pfns); Index: linux-2.6.18-mm3/arch/ia64/mm/discontig.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/discontig.c 2006-10-04 21:04:54.000000000 -0700 +++ linux-2.6.18-mm3/arch/ia64/mm/discontig.c 2006-10-04 21:11:55.000000000 -0700 @@ -697,9 +697,9 @@ #ifdef CONFIG_VIRTUAL_MEM_MAP vmalloc_end -= PAGE_ALIGN(ALIGN(max_low_pfn, MAX_ORDER_NR_PAGES) * sizeof(struct page)); - vmem_map = (struct page *) vmalloc_end; + mem_map = (struct page *) vmalloc_end; efi_memmap_walk(create_mem_map_page_table, NULL); - printk("Virtual mem_map starts at 0x%p\n", vmem_map); + printk("Virtual mem_map starts at 0x%p\n", mem_map); #endif for_each_online_node(node) { @@ -707,7 +707,7 @@ pfn_offset = mem_data[node].min_pfn; #ifdef CONFIG_VIRTUAL_MEM_MAP - NODE_DATA(node)->node_mem_map = vmem_map + pfn_offset; + 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/arch/ia64/mm/init.c =================================================================== --- linux-2.6.18-mm3.orig/arch/ia64/mm/init.c 2006-10-04 21:04:54.000000000 -0700 +++ linux-2.6.18-mm3/arch/ia64/mm/init.c 2006-10-04 21:11:55.000000000 -0700 @@ -48,8 +48,6 @@ #ifdef CONFIG_VIRTUAL_MEM_MAP unsigned long vmalloc_end = VMALLOC_END_INIT; EXPORT_SYMBOL(vmalloc_end); -struct page *vmem_map; -EXPORT_SYMBOL(vmem_map); #endif struct page *zero_page_memmap_ptr; /* map entry for zero page */ @@ -421,10 +419,10 @@ unsigned long stop_address; pg_data_t *pgdat = NODE_DATA(node); - end_address = (unsigned long) &vmem_map[pgdat->node_start_pfn + i]; + end_address = (unsigned long) &mem_map[pgdat->node_start_pfn + i]; end_address = PAGE_ALIGN(end_address); - stop_address = (unsigned long) &vmem_map[ + stop_address = (unsigned long) &mem_map[ pgdat->node_start_pfn + pgdat->node_spanned_pages]; do { @@ -461,12 +459,12 @@ goto retry_pte; continue; } - /* Found next valid vmem_map page */ + /* Found next valid mem_map page */ break; } while (end_address < stop_address); end_address = min(end_address, stop_address); - end_address = end_address - (unsigned long) vmem_map + sizeof(struct page) - 1; + end_address = end_address - (unsigned long) mem_map + sizeof(struct page) - 1; hole_next_pfn = end_address / sizeof(struct page); return hole_next_pfn - pgdat->node_start_pfn; } @@ -482,8 +480,8 @@ pmd_t *pmd; pte_t *pte; - map_start = vmem_map + (__pa(start) >> PAGE_SHIFT); - map_end = vmem_map + (__pa(end) >> PAGE_SHIFT); + map_start = mem_map + (__pa(start) >> PAGE_SHIFT); + map_end = mem_map + (__pa(end) >> PAGE_SHIFT); start_page = (unsigned long) map_start & PAGE_MASK; end_page = PAGE_ALIGN((unsigned long) map_end); @@ -524,8 +522,8 @@ struct page *map_start, *map_end; args = (struct memmap_init_callback_data *) arg; - map_start = vmem_map + (__pa(start) >> PAGE_SHIFT); - map_end = vmem_map + (__pa(end) >> PAGE_SHIFT); + map_start = mem_map + (__pa(start) >> PAGE_SHIFT); + map_end = mem_map + (__pa(end) >> PAGE_SHIFT); if (map_start < args->start) map_start = args->start; @@ -551,7 +549,7 @@ memmap_init (unsigned long size, int nid, unsigned long zone, unsigned long start_pfn) { - if (!vmem_map) + if (!mem_map) memmap_init_zone(size, nid, zone, start_pfn); else { struct page *start; Index: linux-2.6.18-mm3/include/asm-ia64/meminit.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-ia64/meminit.h 2006-10-04 21:04:57.000000000 -0700 +++ linux-2.6.18-mm3/include/asm-ia64/meminit.h 2006-10-04 21:11:55.000000000 -0700 @@ -54,7 +54,6 @@ #ifdef CONFIG_VIRTUAL_MEM_MAP # define LARGE_GAP 0x40000000 /* Use virtual mem map if hole is > than this */ extern unsigned long vmalloc_end; - extern struct page *vmem_map; extern int find_largest_hole (u64 start, u64 end, void *arg); extern int register_active_ranges (u64 start, u64 end, void *arg); extern int create_mem_map_page_table (u64 start, u64 end, void *arg); Index: linux-2.6.18-mm3/mm/memory.c =================================================================== --- linux-2.6.18-mm3.orig/mm/memory.c 2006-10-04 21:04:59.000000000 -0700 +++ linux-2.6.18-mm3/mm/memory.c 2006-10-04 21:11:55.000000000 -0700 @@ -60,7 +60,7 @@ #include #include -#ifndef CONFIG_NEED_MULTIPLE_NODES +#if defined(CONFIG_VIRTUAL_MEM_MAP) || !defined(CONFIG_NEED_MULTIPLE_NODES) /* use the per-pgdat data instead for discontigmem - mbligh */ unsigned long max_mapnr; struct page *mem_map; Index: linux-2.6.18-mm3/include/asm-ia64/page.h =================================================================== --- linux-2.6.18-mm3.orig/include/asm-ia64/page.h 2006-10-04 21:13:25.000000000 -0700 +++ linux-2.6.18-mm3/include/asm-ia64/page.h 2006-10-04 21:13:45.000000000 -0700 @@ -106,15 +106,15 @@ #endif #ifdef CONFIG_VIRTUAL_MEM_MAP -extern struct page *vmem_map; +extern struct page *mem_map; #ifdef CONFIG_DISCONTIGMEM -# define page_to_pfn(page) ((unsigned long) (page - vmem_map)) -# define pfn_to_page(pfn) (vmem_map + (pfn)) +# define page_to_pfn(page) ((unsigned long) (page - mem_map)) +# define pfn_to_page(pfn) (mem_map + (pfn)) #endif #endif #if defined(CONFIG_FLATMEM) || defined(CONFIG_SPARSEMEM) -/* FLATMEM always configures mem_map (mem_map = vmem_map if necessary) */ +/* FLATMEM always configures mem_map */ #include #endif