* [2/4] x86_64: Fix K8 NUMA parsing
@ 2005-01-12 7:02 Andi Kleen
0 siblings, 0 replies; only message in thread
From: Andi Kleen @ 2005-01-12 7:02 UTC (permalink / raw)
To: torvalds, akpm, discuss, vandrove, linux-kernel
Fix k8 NUMA discovery
Fix K8 node discovery after nodemask changes.
Signed-off-by: Andi Kleen <ak@suse.de>
Index: linux/arch/x86_64/mm/k8topology.c
===================================================================
--- linux.orig/arch/x86_64/mm/k8topology.c 2005-01-09 18:19:17.%N +0100
+++ linux/arch/x86_64/mm/k8topology.c 2005-01-12 06:49:42.%N +0100
@@ -47,6 +47,10 @@
int nodeid, i, nb;
int found = 0;
u32 reg;
+ unsigned numnodes;
+ nodemask_t nodes_parsed;
+
+ nodes_clear(nodes_parsed);
nb = find_northbridge();
if (nb < 0)
@@ -55,10 +59,9 @@
printk(KERN_INFO "Scanning NUMA topology in Northbridge %d\n", nb);
reg = read_pci_config(0, nb, 0, 0x60);
- for (i = 0; i <= ((reg >> 4) & 7); i++)
- node_set_online(i);
+ numnodes = ((reg >> 4) & 7) + 1;
- printk(KERN_INFO "Number of nodes %d (%x)\n", num_online_nodes(), reg);
+ printk(KERN_INFO "Number of nodes %d\n", numnodes);
memset(&nodes,0,sizeof(nodes));
prevbase = 0;
@@ -70,11 +73,11 @@
nodeid = limit & 7;
if ((base & 3) == 0) {
- if (i < num_online_nodes())
+ if (i < numnodes)
printk("Skipping disabled node %d\n", i);
continue;
}
- if (nodeid >= num_online_nodes()) {
+ if (nodeid >= numnodes) {
printk("Ignoring excess node %d (%lx:%lx)\n", nodeid,
base, limit);
continue;
@@ -90,7 +93,7 @@
nodeid, (base>>8)&3, (limit>>8) & 3);
return -1;
}
- if (node_online(nodeid)) {
+ if (node_isset(nodeid, nodes_parsed)) {
printk(KERN_INFO "Node %d already present. Skipping\n",
nodeid);
continue;
@@ -138,6 +141,8 @@
nodes[nodeid].end = limit;
prevbase = base;
+
+ node_set(nodeid, nodes_parsed);
}
if (!found)
@@ -154,8 +159,8 @@
if (nodes[i].start != nodes[i].end) {
/* assume 1:1 NODE:CPU */
cpu_to_node[i] = i;
- setup_node_bootmem(i, nodes[i].start, nodes[i].end);
- }
+ setup_node_bootmem(i, nodes[i].start, nodes[i].end);
+ }
}
numa_init_array();
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-12 7:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12 7:02 [2/4] x86_64: Fix K8 NUMA parsing Andi Kleen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome