aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index ebd425c2e2a7..aa6fcc7ca66f 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -853,7 +853,7 @@ again:
853 pcp = &zone_pcp(zone, cpu)->pcp[cold]; 853 pcp = &zone_pcp(zone, cpu)->pcp[cold];
854 local_irq_save(flags); 854 local_irq_save(flags);
855 if (!pcp->count) { 855 if (!pcp->count) {
856 pcp->count += rmqueue_bulk(zone, 0, 856 pcp->count = rmqueue_bulk(zone, 0,
857 pcp->batch, &pcp->list); 857 pcp->batch, &pcp->list);
858 if (unlikely(!pcp->count)) 858 if (unlikely(!pcp->count))
859 goto failed; 859 goto failed;
@@ -1689,6 +1689,8 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
1689 for (pfn = start_pfn; pfn < end_pfn; pfn++) { 1689 for (pfn = start_pfn; pfn < end_pfn; pfn++) {
1690 if (!early_pfn_valid(pfn)) 1690 if (!early_pfn_valid(pfn))
1691 continue; 1691 continue;
1692 if (!early_pfn_in_nid(pfn, nid))
1693 continue;
1692 page = pfn_to_page(pfn); 1694 page = pfn_to_page(pfn);
1693 set_page_links(page, zone, nid, pfn); 1695 set_page_links(page, zone, nid, pfn);
1694 init_page_count(page); 1696 init_page_count(page);
@@ -2259,7 +2261,7 @@ unsigned long __init __absent_pages_in_range(int nid,
2259 2261
2260 /* Account for ranges past physical memory on this node */ 2262 /* Account for ranges past physical memory on this node */
2261 if (range_end_pfn > prev_end_pfn) 2263 if (range_end_pfn > prev_end_pfn)
2262 hole_pages = range_end_pfn - 2264 hole_pages += range_end_pfn -
2263 max(range_start_pfn, prev_end_pfn); 2265 max(range_start_pfn, prev_end_pfn);
2264 2266
2265 return hole_pages; 2267 return hole_pages;
@@ -2405,7 +2407,7 @@ static void __meminit free_area_init_core(struct pglist_data *pgdat,
2405 zone->zone_pgdat = pgdat; 2407 zone->zone_pgdat = pgdat;
2406 zone->free_pages = 0; 2408 zone->free_pages = 0;
2407 2409
2408 zone->temp_priority = zone->prev_priority = DEF_PRIORITY; 2410 zone->prev_priority = DEF_PRIORITY;
2409 2411
2410 zone_pcp_init(zone); 2412 zone_pcp_init(zone);
2411 INIT_LIST_HEAD(&zone->active_list); 2413 INIT_LIST_HEAD(&zone->active_list);
@@ -2610,6 +2612,9 @@ unsigned long __init find_min_pfn_for_node(unsigned long nid)
2610{ 2612{
2611 int i; 2613 int i;
2612 2614
2615 /* Regions in the early_node_map can be in any order */
2616 sort_node_map();
2617
2613 /* 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 */
2614 for_each_active_range_index_in_nid(i, nid) 2619 for_each_active_range_index_in_nid(i, nid)
2615 return early_node_map[i].start_pfn; 2620 return early_node_map[i].start_pfn;
@@ -2678,9 +2683,6 @@ void __init free_area_init_nodes(unsigned long *max_zone_pfn)
2678 max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]); 2683 max(max_zone_pfn[i], arch_zone_lowest_possible_pfn[i]);
2679 } 2684 }
2680 2685
2681 /* Regions in the early_node_map can be in any order */
2682 sort_node_map();
2683
2684 /* Print out the zone ranges */ 2686 /* Print out the zone ranges */
2685 printk("Zone PFN ranges:\n"); 2687 printk("Zone PFN ranges:\n");
2686 for (i = 0; i < MAX_NR_ZONES; i++) 2688 for (i = 0; i < MAX_NR_ZONES; i++)