aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-09-24 03:56:20 -0400
committerIngo Molnar <mingo@elte.hu>2008-09-24 03:56:20 -0400
commitebdd90a8cb2e3963f55499850f02ce6003558b55 (patch)
treed153f917ed41d257ddafa22f9cc2201bfddf8f9c /mm/page_alloc.c
parent3c9339049df5cc3a468c11de6c4101a1ea8c3d83 (diff)
parent72d31053f62c4bc464c2783974926969614a8649 (diff)
Merge commit 'v2.6.27-rc7' into x86/pebs
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c32
1 files changed, 11 insertions, 21 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 6da667274df5..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;
@@ -2372,7 +2375,7 @@ static void build_zonelist_cache(pg_data_t *pgdat)
2372 2375
2373#endif /* CONFIG_NUMA */ 2376#endif /* CONFIG_NUMA */
2374 2377
2375/* return values int ....just for stop_machine_run() */ 2378/* return values int ....just for stop_machine() */
2376static int __build_all_zonelists(void *dummy) 2379static int __build_all_zonelists(void *dummy)
2377{ 2380{
2378 int nid; 2381 int nid;
@@ -2397,7 +2400,7 @@ void build_all_zonelists(void)
2397 } else { 2400 } else {
2398 /* we have to stop all cpus to guarantee there is no user 2401 /* we have to stop all cpus to guarantee there is no user
2399 of zonelist */ 2402 of zonelist */
2400 stop_machine_run(__build_all_zonelists, NULL, NR_CPUS); 2403 stop_machine(__build_all_zonelists, NULL, NULL);
2401 /* cpuset refresh routine should be here */ 2404 /* cpuset refresh routine should be here */
2402 } 2405 }
2403 vm_total_pages = nr_free_pagecache_pages(); 2406 vm_total_pages = nr_free_pagecache_pages();
@@ -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 {