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 81 unsigned numnodes, cores, bits, apicid_base; 82 82 unsigned long prevbase; 83 83 struct bootnode nodes[8]; 84 - unsigned char nodeids[8]; 85 84 int i, j, nb, found = 0; 86 85 u32 nodeid, reg; 87 86 ··· 109 110 limit = read_pci_config(0, nb, 1, 0x44 + i*8); 110 111 111 112 nodeid = limit & 7; 112 - nodeids[i] = nodeid; 113 113 if ((base & 3) == 0) { 114 114 if (i < numnodes) 115 115 printk("Skipping disabled node %d\n", i); ··· 177 179 178 180 nodes[nodeid].start = base; 179 181 nodes[nodeid].end = limit; 180 - e820_register_active_regions(nodeid, 181 - nodes[nodeid].start >> PAGE_SHIFT, 182 - nodes[nodeid].end >> PAGE_SHIFT); 183 182 184 183 prevbase = base; 185 184 ··· 206 211 } 207 212 208 213 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 - } 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); 215 223 } 216 224 217 225 numa_init_array();