diff options
author | Bob Picco <bob.picco@hp.com> | 2007-01-30 05:11:09 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2007-02-05 18:07:47 -0500 |
commit | 139b830477ccdca21b68c40f9a83ec327e65eb56 (patch) | |
tree | 0aab2140315579525dfef89189b9bea5033af2ba /arch/ia64/mm/discontig.c | |
parent | d1598e05faa11d9f04e0a226122dd57674fb1dab (diff) |
[IA64] register memory ranges in a consistent manner
While pursuing and unrelated issue with 64Mb granules I noticed a problem
related to inconsistent use of add_active_range. There doesn't appear any
reason to me why FLATMEM versus DISCONTIG_MEM should register memory to
add_active_range with different code. So I've changed the code into a
common implementation.
The other subtle issue fixed by this patch was calling add_active_range in
count_node_pages before granule aligning is performed. We were lucky with
16MB granules but not so with 64MB granules. count_node_pages has reserved
regions filtered out and as a consequence linked kernel text and data
aren't covered by calls to count_node_pages. So linked kernel regions
wasn't reported to add_active_regions. This resulted in free_initmem
causing numerous bad_page reports. This won't occur with this patch
because now all known memory regions are reported by
register_active_ranges.
Acked-by: Mel Gorman <mel@csn.ul.ie>
Signed-off-by: Bob Picco <bob.picco@hp.com>
Acked-by: Simon Horman <horms@verge.net.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/mm/discontig.c')
-rw-r--r-- | arch/ia64/mm/discontig.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/ia64/mm/discontig.c b/arch/ia64/mm/discontig.c index d3edb12f3cf9..999cefd2b226 100644 --- a/arch/ia64/mm/discontig.c +++ b/arch/ia64/mm/discontig.c | |||
@@ -473,6 +473,9 @@ void __init find_memory(void) | |||
473 | node_clear(node, memory_less_mask); | 473 | node_clear(node, memory_less_mask); |
474 | mem_data[node].min_pfn = ~0UL; | 474 | mem_data[node].min_pfn = ~0UL; |
475 | } | 475 | } |
476 | |||
477 | efi_memmap_walk(register_active_ranges, NULL); | ||
478 | |||
476 | /* | 479 | /* |
477 | * Initialize the boot memory maps in reverse order since that's | 480 | * Initialize the boot memory maps in reverse order since that's |
478 | * what the bootmem allocator expects | 481 | * what the bootmem allocator expects |
@@ -660,7 +663,6 @@ static __init int count_node_pages(unsigned long start, unsigned long len, int n | |||
660 | { | 663 | { |
661 | unsigned long end = start + len; | 664 | unsigned long end = start + len; |
662 | 665 | ||
663 | add_active_range(node, start >> PAGE_SHIFT, end >> PAGE_SHIFT); | ||
664 | mem_data[node].num_physpages += len >> PAGE_SHIFT; | 666 | mem_data[node].num_physpages += len >> PAGE_SHIFT; |
665 | if (start <= __pa(MAX_DMA_ADDRESS)) | 667 | if (start <= __pa(MAX_DMA_ADDRESS)) |
666 | mem_data[node].num_dma_physpages += | 668 | mem_data[node].num_dma_physpages += |