x86: k8 numa register active regions later

Impact: cleanup

don't register early, so we don't need to clear actived regions if it fail
to get node hash shift or wild set in nb config.

also remove nodeids array that is not needed

Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

authored by

Yinghai Lu and committed by
Ingo Molnar
40bcc69b 238c6d54

+9 -11
+9 -11
arch/x86/mm/k8topology_64.c
··· 81 unsigned numnodes, cores, bits, apicid_base; 82 unsigned long prevbase; 83 struct bootnode nodes[8]; 84 - unsigned char nodeids[8]; 85 int i, j, nb, found = 0; 86 u32 nodeid, reg; 87 ··· 109 limit = read_pci_config(0, nb, 1, 0x44 + i*8); 110 111 nodeid = limit & 7; 112 - nodeids[i] = nodeid; 113 if ((base & 3) == 0) { 114 if (i < numnodes) 115 printk("Skipping disabled node %d\n", i); ··· 177 178 nodes[nodeid].start = base; 179 nodes[nodeid].end = limit; 180 - e820_register_active_regions(nodeid, 181 - nodes[nodeid].start >> PAGE_SHIFT, 182 - nodes[nodeid].end >> PAGE_SHIFT); 183 184 prevbase = base; 185 ··· 206 } 207 208 for (i = 0; i < 8; i++) { 209 - if (nodes[i].start != nodes[i].end) { 210 - nodeid = nodeids[i]; 211 - for (j = apicid_base; j < cores + apicid_base; j++) 212 - apicid_to_node[(nodeid << bits) + j] = i; 213 - setup_node_bootmem(i, nodes[i].start, nodes[i].end); 214 - } 215 } 216 217 numa_init_array();
··· 81 unsigned numnodes, cores, bits, apicid_base; 82 unsigned long prevbase; 83 struct bootnode nodes[8]; 84 int i, j, nb, found = 0; 85 u32 nodeid, reg; 86 ··· 110 limit = read_pci_config(0, nb, 1, 0x44 + i*8); 111 112 nodeid = limit & 7; 113 if ((base & 3) == 0) { 114 if (i < numnodes) 115 printk("Skipping disabled node %d\n", i); ··· 179 180 nodes[nodeid].start = base; 181 nodes[nodeid].end = limit; 182 183 prevbase = base; 184 ··· 211 } 212 213 for (i = 0; i < 8; i++) { 214 + if (nodes[i].start == nodes[i].end) 215 + continue; 216 + 217 + e820_register_active_regions(i, 218 + nodes[i].start >> PAGE_SHIFT, 219 + nodes[i].end >> PAGE_SHIFT); 220 + for (j = apicid_base; j < cores + apicid_base; j++) 221 + apicid_to_node[(i << bits) + j] = i; 222 + setup_node_bootmem(i, nodes[i].start, nodes[i].end); 223 } 224 225 numa_init_array();