The patch titled FLATMEM: relax requirement for memory to start at pfn 0 has been added to the -mm tree. Its filename is flatmem-relax-requirement-for-memory-to-start-at-pfn-0.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: FLATMEM: relax requirement for memory to start at pfn 0 From: Andy Whitcroft <apw@xxxxxxxxxxxx> The FLATMEM memory model assumes that memory is in one contigious area based at pfn 0. If we initialise node 0 to start at any other offset we will incorrectly map pfn's to the wrong struct page *. The key to the memory model is the contigious nature of the memory not the location of it. Relax the requirement for the area to start at 0. Signed-off-by: Andy Whitcroft <apw@xxxxxxxxxxxx> Acked-by: Mel Gorman <mel@xxxxxxxxx> Cc: Dave Hansen <haveblue@xxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- mm/page_alloc.c | 17 +++++++++++++---- 1 files changed, 13 insertions(+), 4 deletions(-) diff -puN mm/page_alloc.c~flatmem-relax-requirement-for-memory-to-start-at-pfn-0 mm/page_alloc.c --- 25/mm/page_alloc.c~flatmem-relax-requirement-for-memory-to-start-at-pfn-0 Fri May 19 13:51:18 2006 +++ 25-akpm/mm/page_alloc.c Fri May 19 13:51:18 2006 @@ -2199,15 +2199,16 @@ static void __meminit free_area_init_cor static void __init alloc_node_mem_map(struct pglist_data *pgdat) { +#ifdef CONFIG_FLAT_NODE_MEM_MAP + struct page *map = pgdat->node_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) { + if (!map) { unsigned long size, start, end; - struct page *map; /* * The zone's endpoints aren't required to be MAX_ORDER @@ -2222,13 +2223,21 @@ static void __init alloc_node_mem_map(st if (!map) map = alloc_bootmem_node(pgdat, size); pgdat->node_mem_map = map + (pgdat->node_start_pfn - start); + + /* + * With FLATMEM the global mem_map is used. This is assumed + * to be based at pfn 0 such that 'pfn = page* - mem_map' + * is true. Adjust map relative to node_mem_map to + * maintain this relationship. + */ + map -= pgdat->node_start_pfn; } #ifdef CONFIG_FLATMEM /* * 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; + mem_map = map; #endif #endif /* CONFIG_FLAT_NODE_MEM_MAP */ } _ Patches currently in -mm which might be from apw@xxxxxxxxxxxx are origin.patch sparsemem-incorrectly-calculates-section-number.patch zone-init-check-and-report-unaligned-zone-boundaries.patch zone-init-check-and-report-unaligned-zone-boundaries-fix-v2.patch x86-align-highmem-zone-boundaries-with-numa.patch zone-allow-unaligned-zone-boundaries.patch zone-allow-unaligned-zone-boundaries-spelling-fix.patch pg_uncached-is-ia64-only.patch squash-duplicate-page_to_pfn-and-pfn_to_page.patch align-the-node_mem_map-endpoints-to-a-max_order-boundary.patch flatmem-relax-requirement-for-memory-to-start-at-pfn-0.patch introduce-mechanism-for-registering-active-regions-of-memory.patch have-power-use-add_active_range-and-free_area_init_nodes.patch have-x86-use-add_active_range-and-free_area_init_nodes.patch have-x86_64-use-add_active_range-and-free_area_init_nodes.patch have-ia64-use-add_active_range-and-free_area_init_nodes.patch sparsemem-record-nid-during-memory-present.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html