aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/mm/numa.c
diff options
context:
space:
mode:
authorSuresh Siddha <suresh.b.siddha@intel.com>2007-05-02 13:27:20 -0400
committerAndi Kleen <andi@basil.nowhere.org>2007-05-02 13:27:20 -0400
commite3f1caeef9a70b0699518092d653c15274b025ab (patch)
tree23d89175f809cb7a53377fa68b295f6ce162f99b /arch/x86_64/mm/numa.c
parent8a336b0a4b6dfacc8cc5fd617ba1e1904077de2d (diff)
[PATCH] x86-64: set node_possible_map at runtime - try 2
Set the node_possible_map at runtime on x86_64. On a non NUMA system, num_possible_nodes() will now say '1'. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <andi@firstfloor.org> Cc: Eric Dumazet <dada1@cosmosbay.com> Cc: David Rientjes <rientjes@google.com> Cc: Christoph Lameter <clameter@engr.sgi.com>
Diffstat (limited to 'arch/x86_64/mm/numa.c')
-rw-r--r--arch/x86_64/mm/numa.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/arch/x86_64/mm/numa.c b/arch/x86_64/mm/numa.c
index 5ee07bc41eb5..51548947ad3b 100644
--- a/arch/x86_64/mm/numa.c
+++ b/arch/x86_64/mm/numa.c
@@ -295,7 +295,7 @@ static int __init setup_node_range(int nid, struct bootnode *nodes, u64 *addr,
295 ret = -1; 295 ret = -1;
296 } 296 }
297 nodes[nid].end = *addr; 297 nodes[nid].end = *addr;
298 node_set_online(nid); 298 node_set(nid, node_possible_map);
299 printk(KERN_INFO "Faking node %d at %016Lx-%016Lx (%LuMB)\n", nid, 299 printk(KERN_INFO "Faking node %d at %016Lx-%016Lx (%LuMB)\n", nid,
300 nodes[nid].start, nodes[nid].end, 300 nodes[nid].start, nodes[nid].end,
301 (nodes[nid].end - nodes[nid].start) >> 20); 301 (nodes[nid].end - nodes[nid].start) >> 20);
@@ -479,7 +479,7 @@ out:
479 * SRAT. 479 * SRAT.
480 */ 480 */
481 remove_all_active_ranges(); 481 remove_all_active_ranges();
482 for_each_online_node(i) { 482 for_each_node_mask(i, node_possible_map) {
483 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT, 483 e820_register_active_regions(i, nodes[i].start >> PAGE_SHIFT,
484 nodes[i].end >> PAGE_SHIFT); 484 nodes[i].end >> PAGE_SHIFT);
485 setup_node_bootmem(i, nodes[i].start, nodes[i].end); 485 setup_node_bootmem(i, nodes[i].start, nodes[i].end);
@@ -494,20 +494,25 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
494{ 494{
495 int i; 495 int i;
496 496
497 nodes_clear(node_possible_map);
498
497#ifdef CONFIG_NUMA_EMU 499#ifdef CONFIG_NUMA_EMU
498 if (cmdline && !numa_emulation(start_pfn, end_pfn)) 500 if (cmdline && !numa_emulation(start_pfn, end_pfn))
499 return; 501 return;
502 nodes_clear(node_possible_map);
500#endif 503#endif
501 504
502#ifdef CONFIG_ACPI_NUMA 505#ifdef CONFIG_ACPI_NUMA
503 if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT, 506 if (!numa_off && !acpi_scan_nodes(start_pfn << PAGE_SHIFT,
504 end_pfn << PAGE_SHIFT)) 507 end_pfn << PAGE_SHIFT))
505 return; 508 return;
509 nodes_clear(node_possible_map);
506#endif 510#endif
507 511
508#ifdef CONFIG_K8_NUMA 512#ifdef CONFIG_K8_NUMA
509 if (!numa_off && !k8_scan_nodes(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT)) 513 if (!numa_off && !k8_scan_nodes(start_pfn<<PAGE_SHIFT, end_pfn<<PAGE_SHIFT))
510 return; 514 return;
515 nodes_clear(node_possible_map);
511#endif 516#endif
512 printk(KERN_INFO "%s\n", 517 printk(KERN_INFO "%s\n",
513 numa_off ? "NUMA turned off" : "No NUMA configuration found"); 518 numa_off ? "NUMA turned off" : "No NUMA configuration found");
@@ -521,6 +526,7 @@ void __init numa_initmem_init(unsigned long start_pfn, unsigned long end_pfn)
521 memnodemap[0] = 0; 526 memnodemap[0] = 0;
522 nodes_clear(node_online_map); 527 nodes_clear(node_online_map);
523 node_set_online(0); 528 node_set_online(0);
529 node_set(0, node_possible_map);
524 for (i = 0; i < NR_CPUS; i++) 530 for (i = 0; i < NR_CPUS; i++)
525 numa_set_node(i, 0); 531 numa_set_node(i, 0);
526 node_to_cpumask[0] = cpumask_of_cpu(0); 532 node_to_cpumask[0] = cpumask_of_cpu(0);