On Tue, 2004-12-21 at 19:16, Hiroyuki KAMEZAWA wrote: > I'm sorry for not understanding what is done in alloc_bootmem_node_remap(). > This one wiil meet current -mhp tree. > this one uses HAVE_ARCH_ALLOC_REMAP and never modifies mm/page_alloc.c This does look better, especially since it stays in arch/ia64. A few tiny comments, though. > diff -puN arch/ia64/mm/contig.c~contig3 arch/ia64/mm/contig.c > --- test-kernel/arch/ia64/mm/contig.c~contig3 2004-12-22 12:04:45.639948552 +0900 > +++ test-kernel-kamezawa/arch/ia64/mm/contig.c 2004-12-22 12:04:45.648947184 +0900 > @@ -231,7 +231,6 @@ paging_init (void) > unsigned long zones_size[MAX_NR_ZONES]; > #ifdef CONFIG_VIRTUAL_MEM_MAP > unsigned long zholes_size[MAX_NR_ZONES]; > - unsigned long max_gap; > #endif > > /* initialize mem_map[] */ > @@ -262,29 +261,9 @@ paging_init (void) > (num_physpages - num_dma_physpages)); > } > } > + vmem_map = 0; NULL, please. > + free_area_init_node(0, &contig_page_data, zones_size, 0, zholes_size); Please use NODE_DATA(0) instead of contig_page_data. We've been trying to slowly replace all of those. > +struct page *__init alloc_vmem_map(unsigned long size) > +{ > +#ifndef CONFIG_DISCONTIGMEM > + unsigned long max_gap; > + efi_memmap_walk(find_largest_hole, (u64 *)&max_gap); > + if (max_gap < LARGE_GAP) { > + vmem_map = (struct page *)0; Using NULL here will avoid the cast. > + return alloc_bootmem(size); > + } > +#endif It seems a little bit odd to me that the efi walk is done under CONFIG_DISCONTIGMEM. I just question whether this is completely necessary. But, I don't really care all that much about ia64. :) > + size = PAGE_ALIGN(max_low_pfn * sizeof(struct page)); > + vmalloc_end -= size; > + vmem_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); > + return vmem_map; > +} > + > +void * alloc_remap(int nid, unsigned long size) > +{ > + struct page *lmem_map; > + if (nid == 0) > + return alloc_vmem_map(size); > + return vmem_map + NODE_DATA(nid)->node_start_pfn; > +} Are my eyes just missing where lmem_map is used, or is it really unused here? It does seem a wee bit hackish to special-case node 0 to be the effective initalization call, but I think I can live with it if that other stuff is addressed. -- Dave