aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/numa.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/mm/numa.c')
-rw-r--r--arch/x86_64/mm/numa.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 322bf45fc36a..829a008bd39b 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -161,7 +161,7 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en
161 bootmap_start >> PAGE_SHIFT, 161 bootmap_start >> PAGE_SHIFT,
162 start_pfn, end_pfn); 162 start_pfn, end_pfn);
163 163
164 e820_bootmem_free(NODE_DATA(nodeid), start, end); 164 free_bootmem_with_active_regions(nodeid, end);
165 165
166 reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size); 166 reserve_bootmem_node(NODE_DATA(nodeid), nodedata_phys, pgdat_size);
167 reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages<<PAGE_SHIFT); 167 reserve_bootmem_node(NODE_DATA(nodeid), bootmap_start, bootmap_pages<<PAGE_SHIFT);
@@ -175,13 +175,11 @@ void __init setup_node_bootmem(int nodeid, unsigned long start, unsigned long en
175void __init setup_node_zones(int nodeid) 175void __init setup_node_zones(int nodeid)
176{ 176{
177 unsigned long start_pfn, end_pfn, memmapsize, limit; 177 unsigned long start_pfn, end_pfn, memmapsize, limit;
178 unsigned long zones[MAX_NR_ZONES];
179 unsigned long holes[MAX_NR_ZONES];
180 178
181 start_pfn = node_start_pfn(nodeid); 179 start_pfn = node_start_pfn(nodeid);
182 end_pfn = node_end_pfn(nodeid); 180 end_pfn = node_end_pfn(nodeid);
183 181
184 Dprintk(KERN_INFO "Setting up node %d %lx-%lx\n", 182 Dprintk(KERN_INFO "Setting up memmap for node %d %lx-%lx\n",
185 nodeid, start_pfn, end_pfn); 183 nodeid, start_pfn, end_pfn);
186 184
187 /* Try to allocate mem_map at end to not fill up precious <4GB 185 /* Try to allocate mem_map at end to not fill up precious <4GB
@@ -195,10 +193,6 @@ void __init setup_node_zones(int nodeid)
195 round_down(limit - memmapsize, PAGE_SIZE), 193 round_down(limit - memmapsize, PAGE_SIZE),
196 limit); 194 limit);
197#endif 195#endif
198
199 size_zones(zones, holes, start_pfn, end_pfn);
200 free_area_init_node(nodeid, NODE_DATA(nodeid), zones,
201 start_pfn, holes);
202} 196}
203 197
204void __init numa_init_array(void) 198void __init numa_init_array(void)
@@ -259,8 +253,11 @@ static int __init numa_emulation(unsigned long start_pfn, unsigned long end_pfn)
259 printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n"); 253 printk(KERN_ERR "No NUMA hash function found. Emulation disabled.\n");
260 return -1; 254 return -1;
261 } 255 }
262 for_each_online_node(i) 256 for_each_online_node(i) {
257 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
258 nodes[i].end >> PAGE_SHIFT);
263 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 259 setup_node_bootmem(i, nodes[i].start, nodes[i].end);
260 }
264 numa_init_array(); 261 numa_init_array();
265 return 0; 262 return 0;
266} 263}
@@ -299,6 +296,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
299 for (i = 0; i < NR_CPUS; i++) 296 for (i = 0; i < NR_CPUS; i++)
300 numa_set_node(i, 0); 297 numa_set_node(i, 0);
301 node_to_cpumask[0] = cpumask_of_cpu(0); 298 node_to_cpumask[0] = cpumask_of_cpu(0);
299 e820_register_active_regions(0, start_pfn, end_pfn);
302 setup_node_bootmem(0, start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT); 300 setup_node_bootmem(0, start_pfn << PAGE_SHIFT, end_pfn << PAGE_SHIFT);
303} 301}
304 302
@@ -340,12 +338,17 @@ static void __init arch_sparse_init(void)
340void __init paging_init(void) 338void __init paging_init(void)
341{ 339{
342 int i; 340 int i;
341 unsigned long max_zone_pfns[MAX_NR_ZONES] = { MAX_DMA_PFN,
342 MAX_DMA32_PFN,
343 end_pfn};
343 344
344 arch_sparse_init(); 345 arch_sparse_init();
345 346
346 for_each_online_node(i) { 347 for_each_online_node(i) {
347 setup_node_zones(i); 348 setup_node_zones(i);
348 } 349 }
350
351 free_area_init_nodes(max_zone_pfns);
349} 352}
350 353
351static __init int numa_setup(char *opt) 354static __init int numa_setup(char *opt)