Dave Hansen wrote: [Fri Mar 04 2005, 05:19:47PM EST] > ... trying to set a replying to myself record > > I sent the wrong patch, but here's the important part: > > -void __init node_alloc_mem_map(struct pglist_data *pgdat) > +static void __init alloc_node_mem_map(struct pglist_data *pgdat) > { > unsigned long size; > > - size = (pgdat->node_spanned_pages + 1) * sizeof(struct page); > - pgdat->node_mem_map = alloc_bootmem_node(pgdat, size); > + /* Skip empty nodes */ > + if (!pgdat->node_spanned_pages) > + return; > + > + /* ia64 gets its own node_mem_map, before this, without bootmem */ > + if (!pgdat->node_mem_map) { > + size = (pgdat->node_spanned_pages + 1) * sizeof(struct page); > + pgdat->node_mem_map = alloc_bootmem_node(pgdat, size); > + } > #ifndef CONFIG_DISCONTIGMEM > - mem_map = contig_page_data.node_mem_map; > + /* > + * With no DISCONTIG, the global mem_map is just set as node 0's > + */ > + if (pgdat == NODE_DATA(0)) > + mem_map = NODE_DATA(0)->node_mem_map; > #endif > } > > > -- Dave > Dave, Sorry for delay. I was tied up on other things on Friday. Well this patch doesn't apply. However, I can tell you that it will work for FLATMEM on ia64. The ia64 node_mem_map/mem_map memory will be allocated in paging_init by VIRTUAL_MEMMAP when a large memory hole is detected. The absence of a large memory hole results in the allocation being done in alloc_node_mem_map. ia64 DISCONTIGMEM will have NODE_DATA(X)->node_mem_map populated before making the call to free_area_init_node. SPARSEMEM shouldn't really call alloc_node_mem_map. The patch also has me confused. What happened to alloc_remap? Well I hand applied patch and boot tested on FLATMEM. I have two patches to propose. The first one is an alternative to your patch and my original one. ia64 FLATMEM requirements are satisfied by using alloc_remap in ia64 FLATMEM code. There aren't any changes required to alloc_node_mem_map. This was boot tested on all three memory models. The second patch will be another reply your email. bob diff -ruNp -X /home/picco/losl/dontdiff-osdl linux-2.6.11-mhp1-orig/arch/ia64/Kconfig linux-2.6.11-mhp1/arch/ia64/Kconfig --- linux-2.6.11-mhp1-orig/arch/ia64/Kconfig 2005-03-03 20:03:48.000000000 -0500 +++ linux-2.6.11-mhp1/arch/ia64/Kconfig 2005-03-05 17:27:55.000000000 -0500 @@ -264,6 +264,11 @@ config PREEMPT Say Y here if you are building a kernel for a desktop, embedded or real-time system. Say N if you are unsure. +config HAVE_ARCH_ALLOC_REMAP + bool + depends on FLATMEM + default y if FLATMEM + config SECTION_BITS int depends on SPARSEMEM diff -ruNp -X /home/picco/losl/dontdiff-osdl linux-2.6.11-mhp1-orig/arch/ia64/mm/contig.c linux-2.6.11-mhp1/arch/ia64/mm/contig.c --- linux-2.6.11-mhp1-orig/arch/ia64/mm/contig.c 2005-03-03 20:03:46.000000000 -0500 +++ linux-2.6.11-mhp1/arch/ia64/mm/contig.c 2005-03-05 17:31:27.315595648 -0500 @@ -221,6 +221,11 @@ count_dma_pages (u64 start, u64 end, voi } #endif +void __init *alloc_remap(int nid, unsigned long size) +{ + return vmem_map; +} + /* * Set up the page tables. */ @@ -280,7 +285,6 @@ paging_init (void) vmem_map = (struct page *) vmalloc_end; efi_memmap_walk(create_mem_map_page_table, NULL); - NODE_DATA(0)->node_mem_map = vmem_map; free_area_init_node(0, &contig_page_data, zones_size, 0, zholes_size);