x86: prepare for cpumask iterators to only go to nr_cpu_ids
Impact: cleanup, futureproof In fact, all cpumask ops will only be valid (in general) for bit numbers < nr_cpu_ids. So use that instead of NR_CPUS in various places. This is always safe: no cpu number can be >= nr_cpu_ids, and nr_cpu_ids is initialized to NR_CPUS at boot. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Acked-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
@@ -278,7 +278,7 @@ void __init numa_init_array(void)
|
||||
int rr, i;
|
||||
|
||||
rr = first_node(node_online_map);
|
||||
for (i = 0; i < NR_CPUS; i++) {
|
||||
for (i = 0; i < nr_cpu_ids; i++) {
|
||||
if (early_cpu_to_node(i) != NUMA_NO_NODE)
|
||||
continue;
|
||||
numa_set_node(i, rr);
|
||||
@@ -549,7 +549,7 @@ void __init initmem_init(unsigned long start_pfn, unsigned long last_pfn)
|
||||
memnodemap[0] = 0;
|
||||
node_set_online(0);
|
||||
node_set(0, node_possible_map);
|
||||
for (i = 0; i < NR_CPUS; i++)
|
||||
for (i = 0; i < nr_cpu_ids; i++)
|
||||
numa_set_node(i, 0);
|
||||
e820_register_active_regions(0, start_pfn, last_pfn);
|
||||
setup_node_bootmem(0, start_pfn << PAGE_SHIFT, last_pfn << PAGE_SHIFT);
|
||||
|
Reference in New Issue
Block a user