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.c28
1 files changed, 9 insertions, 19 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 3cf3d05b6bd4..e293c58bea58 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -694,6 +694,9 @@ static int move_freepages(struct zone *zone,
694#endif 694#endif
695 695
696 for (page = start_page; page <= end_page;) { 696 for (page = start_page; page <= end_page;) {
697 /* Make sure we are not inadvertently changing nodes */
698 VM_BUG_ON(page_to_nid(page) != zone_to_nid(zone));
699
697 if (!pfn_valid_within(page_to_pfn(page))) { 700 if (!pfn_valid_within(page_to_pfn(page))) {
698 page++; 701 page++;
699 continue; 702 continue;
@@ -2516,6 +2519,10 @@ static void setup_zone_migrate_reserve(struct zone *zone)
2516 continue; 2519 continue;
2517 page = pfn_to_page(pfn); 2520 page = pfn_to_page(pfn);
2518 2521
2522 /* Watch out for overlapping nodes */
2523 if (page_to_nid(page) != zone_to_nid(zone))
2524 continue;
2525
2519 /* Blocks with reserved pages will never free, skip them. */ 2526 /* Blocks with reserved pages will never free, skip them. */
2520 if (PageReserved(page)) 2527 if (PageReserved(page))
2521 continue; 2528 continue;
@@ -3753,23 +3760,6 @@ unsigned long __init find_min_pfn_with_active_regions(void)
3753 return find_min_pfn_for_node(MAX_NUMNODES); 3760 return find_min_pfn_for_node(MAX_NUMNODES);
3754} 3761}
3755 3762
3756/**
3757 * find_max_pfn_with_active_regions - Find the maximum PFN registered
3758 *
3759 * It returns the maximum PFN based on information provided via
3760 * add_active_range().
3761 */
3762unsigned long __init find_max_pfn_with_active_regions(void)
3763{
3764 int i;
3765 unsigned long max_pfn = 0;
3766
3767 for (i = 0; i < nr_nodemap_entries; i++)
3768 max_pfn = max(max_pfn, early_node_map[i].end_pfn);
3769
3770 return max_pfn;
3771}
3772
3773/* 3763/*
3774 * early_calculate_totalpages() 3764 * early_calculate_totalpages()
3775 * Sum pages in active regions for movable zone. 3765 * Sum pages in active regions for movable zone.
@@ -4081,7 +4071,7 @@ void __init set_dma_reserve(unsigned long new_dma_reserve)
4081} 4071}
4082 4072
4083#ifndef CONFIG_NEED_MULTIPLE_NODES 4073#ifndef CONFIG_NEED_MULTIPLE_NODES
4084struct pglist_data contig_page_data = { .bdata = &bootmem_node_data[0] }; 4074struct pglist_data __refdata contig_page_data = { .bdata = &bootmem_node_data[0] };
4085EXPORT_SYMBOL(contig_page_data); 4075EXPORT_SYMBOL(contig_page_data);
4086#endif 4076#endif
4087 4077
@@ -4454,7 +4444,7 @@ void *__init alloc_large_system_hash(const char *tablename,
4454 do { 4444 do {
4455 size = bucketsize << log2qty; 4445 size = bucketsize << log2qty;
4456 if (flags & HASH_EARLY) 4446 if (flags & HASH_EARLY)
4457 table = alloc_bootmem(size); 4447 table = alloc_bootmem_nopanic(size);
4458 else if (hashdist) 4448 else if (hashdist)
4459 table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL); 4449 table = __vmalloc(size, GFP_ATOMIC, PAGE_KERNEL);
4460 else { 4450 else {