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, Second promised patch. This patch satisfies SPARSEMEM requirements in alloc_node_mem_map. This was boot tested on all three memory models. bob diff -ruNp -X /home/picco/losl/dontdiff-osdl linux-2.6.11-mhp1-orig/mm/page_alloc.c linux-2.6.11-mhp1/mm/page_alloc.c --- linux-2.6.11-mhp1-orig/mm/page_alloc.c 2005-03-03 20:03:50.000000000 -0500 +++ linux-2.6.11-mhp1/mm/page_alloc.c 2005-03-05 09:54:11.000000000 -0500 @@ -1759,7 +1759,7 @@ static void __init free_area_init_core(s } } -static void __init alloc_node_mem_map(struct pglist_data *pgdat) +void __init __attribute__((weak)) alloc_node_mem_map(struct pglist_data *pgdat) { unsigned long size; struct page *map; diff -ruNp -X /home/picco/losl/dontdiff-osdl linux-2.6.11-mhp1-orig/mm/sparse.c linux-2.6.11-mhp1/mm/sparse.c --- linux-2.6.11-mhp1-orig/mm/sparse.c 2005-03-03 20:03:46.000000000 -0500 +++ linux-2.6.11-mhp1/mm/sparse.c 2005-03-05 09:54:15.000000000 -0500 @@ -132,3 +132,11 @@ int sparse_add_one_section(int phys_star return sparse_init_one_section(ms, phys_start_pfn >> PFN_SECTION_SHIFT, map); } + +/* + * This isn't required for sparsemem. + */ +void __init alloc_node_mem_map(struct pglist_data *pgdat) +{ + return; +}