aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/mm/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/powerpc/mm/numa.c')
-rw-r--r--arch/powerpc/mm/numa.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 6cf5c71c431f..eb505ad34a85 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -116,6 +116,7 @@ static int __init get_active_region_work_fn(unsigned long start_pfn,
116 116
117/* 117/*
118 * get_node_active_region - Return active region containing start_pfn 118 * get_node_active_region - Return active region containing start_pfn
119 * Active range returned is empty if none found.
119 * @start_pfn: The page to return the region for. 120 * @start_pfn: The page to return the region for.
120 * @node_ar: Returned set to the active region containing start_pfn 121 * @node_ar: Returned set to the active region containing start_pfn
121 */ 122 */
@@ -126,6 +127,7 @@ static void __init get_node_active_region(unsigned long start_pfn,
126 127
127 node_ar->nid = nid; 128 node_ar->nid = nid;
128 node_ar->start_pfn = start_pfn; 129 node_ar->start_pfn = start_pfn;
130 node_ar->end_pfn = start_pfn;
129 work_with_active_regions(nid, get_active_region_work_fn, node_ar); 131 work_with_active_regions(nid, get_active_region_work_fn, node_ar);
130} 132}
131 133
@@ -526,12 +528,10 @@ static unsigned long __init numa_enforce_memory_limit(unsigned long start,
526 /* 528 /*
527 * We use lmb_end_of_DRAM() in here instead of memory_limit because 529 * We use lmb_end_of_DRAM() in here instead of memory_limit because
528 * we've already adjusted it for the limit and it takes care of 530 * we've already adjusted it for the limit and it takes care of
529 * having memory holes below the limit. 531 * having memory holes below the limit. Also, in the case of
532 * iommu_is_off, memory_limit is not set but is implicitly enforced.
530 */ 533 */
531 534
532 if (! memory_limit)
533 return size;
534
535 if (start + size <= lmb_end_of_DRAM()) 535 if (start + size <= lmb_end_of_DRAM())
536 return size; 536 return size;
537 537
@@ -933,18 +933,20 @@ void __init do_init_bootmem(void)
933 struct node_active_region node_ar; 933 struct node_active_region node_ar;
934 934
935 get_node_active_region(start_pfn, &node_ar); 935 get_node_active_region(start_pfn, &node_ar);
936 while (start_pfn < end_pfn) { 936 while (start_pfn < end_pfn &&
937 node_ar.start_pfn < node_ar.end_pfn) {
938 unsigned long reserve_size = size;
937 /* 939 /*
938 * if reserved region extends past active region 940 * if reserved region extends past active region
939 * then trim size to active region 941 * then trim size to active region
940 */ 942 */
941 if (end_pfn > node_ar.end_pfn) 943 if (end_pfn > node_ar.end_pfn)
942 size = (node_ar.end_pfn << PAGE_SHIFT) 944 reserve_size = (node_ar.end_pfn << PAGE_SHIFT)
943 - (start_pfn << PAGE_SHIFT); 945 - (start_pfn << PAGE_SHIFT);
944 dbg("reserve_bootmem %lx %lx nid=%d\n", physbase, size, 946 dbg("reserve_bootmem %lx %lx nid=%d\n", physbase,
945 node_ar.nid); 947 reserve_size, node_ar.nid);
946 reserve_bootmem_node(NODE_DATA(node_ar.nid), physbase, 948 reserve_bootmem_node(NODE_DATA(node_ar.nid), physbase,
947 size, BOOTMEM_DEFAULT); 949 reserve_size, BOOTMEM_DEFAULT);
948 /* 950 /*
949 * if reserved region is contained in the active region 951 * if reserved region is contained in the active region
950 * then done. 952 * then done.
@@ -959,6 +961,7 @@ void __init do_init_bootmem(void)
959 */ 961 */
960 start_pfn = node_ar.end_pfn; 962 start_pfn = node_ar.end_pfn;
961 physbase = start_pfn << PAGE_SHIFT; 963 physbase = start_pfn << PAGE_SHIFT;
964 size = size - reserve_size;
962 get_node_active_region(start_pfn, &node_ar); 965 get_node_active_region(start_pfn, &node_ar);
963 } 966 }
964 967