diff options
author | Andi Kleen <ak@suse.de> | 2005-09-12 12:49:25 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-12 13:50:58 -0400 |
commit | e58e0d03120d6c2aa134fd3be4f0f762f0bb25e7 (patch) | |
tree | 6960dd1496f2ed91adad8c5ddd416fc05acce1fa | |
parent | 66759a01adbfe8828dd063e32cf5ed3f46696181 (diff) |
[PATCH] x86-64: Clean up the SRAT node list before computing the hash function
Also use for_each_node_mask instead of hand crafted loops.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/mm/srat.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/x86_64/mm/srat.c b/arch/x86_64/mm/srat.c index 36bc7be9afb9..d66b814e5033 100644 --- a/arch/x86_64/mm/srat.c +++ b/arch/x86_64/mm/srat.c | |||
@@ -177,6 +177,14 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
177 | int i; | 177 | int i; |
178 | if (acpi_numa <= 0) | 178 | if (acpi_numa <= 0) |
179 | return -1; | 179 | return -1; |
180 | |||
181 | /* First clean up the node list */ | ||
182 | for_each_node_mask(i, nodes_parsed) { | ||
183 | cutoff_node(i, start, end); | ||
184 | if (nodes[i].start == nodes[i].end) | ||
185 | node_clear(i, nodes_parsed); | ||
186 | } | ||
187 | |||
180 | memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed)); | 188 | memnode_shift = compute_hash_shift(nodes, nodes_weight(nodes_parsed)); |
181 | if (memnode_shift < 0) { | 189 | if (memnode_shift < 0) { |
182 | printk(KERN_ERR | 190 | printk(KERN_ERR |
@@ -184,16 +192,10 @@ int __init acpi_scan_nodes(unsigned long start, unsigned long end) | |||
184 | bad_srat(); | 192 | bad_srat(); |
185 | return -1; | 193 | return -1; |
186 | } | 194 | } |
187 | for (i = 0; i < MAX_NUMNODES; i++) { | 195 | |
188 | if (!node_isset(i, nodes_parsed)) | 196 | /* Finally register nodes */ |
189 | continue; | 197 | for_each_node_mask(i, nodes_parsed) |
190 | cutoff_node(i, start, end); | ||
191 | if (nodes[i].start == nodes[i].end) { | ||
192 | node_clear(i, nodes_parsed); | ||
193 | continue; | ||
194 | } | ||
195 | setup_node_bootmem(i, nodes[i].start, nodes[i].end); | 198 | setup_node_bootmem(i, nodes[i].start, nodes[i].end); |
196 | } | ||
197 | for (i = 0; i < NR_CPUS; i++) { | 199 | for (i = 0; i < NR_CPUS; i++) { |
198 | if (cpu_to_node[i] == NUMA_NO_NODE) | 200 | if (cpu_to_node[i] == NUMA_NO_NODE) |
199 | continue; | 201 | continue; |