aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMel Gorman <mel@skynet.ie>2006-11-23 07:01:41 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-11-23 12:30:38 -0500
commit1abbfb412b1610ec3a7ec0164108cee01191d9f5 (patch)
treeab63b4e9b901455385a55ffa4a30b23343d363eb /mm
parent0b1082efb92eedb28e982cfae526267ebdcf5622 (diff)
[PATCH] x86_64: fix bad page state in process 'swapper'
find_min_pfn_for_node() and find_min_pfn_with_active_regions() both depend on a sorted early_node_map[]. However, sort_node_map() is being called after fin_min_pfn_with_active_regions() in free_area_init_nodes(). In most cases, this is ok, but on at least one x86_64, the SRAT table caused the E820 ranges to be registered out of order. This gave the wrong values for the min PFN range resulting in some pages not being initialised. This patch sorts the early_node_map in find_min_pfn_for_node(). It has been boot tested on x86, x86_64, ppc64 and ia64. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Andre Noll <maan@systemlinux.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/page_alloc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index bf2f6cff1d6a..aa6fcc7ca66f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -2612,6 +2612,9 @@ unsigned long __init find_min_pfn_for_node(unsigned long nid)
2612{ 2612{
2613 int i; 2613 int i;
2614 2614
2615 /* Regions in the early_node_map can be in any order */
2616 sort_node_map();
2617
2615 /* Assuming a sorted map, the first range found has the starting pfn */ 2618 /* Assuming a sorted map, the first range found has the starting pfn */
2616 for_each_active_range_index_in_nid(i, nid) 2619 for_each_active_range_index_in_nid(i, nid)
2617 return early_node_map[i].start_pfn; 2620 return early_node_map[i].start_pfn;
@@ -2680,9 +2683,6 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
2680 max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]); 2683 max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]);
2681 } 2684 }
2682 2685
2683 /* Regions in the early_node_map can be in any order */
2684 sort_node_map();
2685
2686 /* Print out the zone ranges */ 2686 /* Print out the zone ranges */
2687 printk("Zone PFN ranges:\n"); 2687 printk("Zone PFN ranges:\n");
2688 for (i = 0; i < MAX_NR_ZONES; i++) 2688 for (i = 0; i < MAX_NR_ZONES; i++)