Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

cpumask: Use cpu_*_mask accessors code: alpha

Impact: use new API, fix SMP bug.

Use the new accessors rather than frobbing bits directly.

This also removes the bug introduced in ee0c468b (alpha: compile
fixes) which had Alpha setting bits on an on-stack cpumask, not the
cpu_online_map.

Cc: Richard Henderson <rth@twiddle.net>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Mike Travis <travis@sgi.com>
Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Acked-by: Ingo Molnar <mingo@elte.hu>

+10 -10
+4 -4
arch/alpha/kernel/process.c
··· 93 93 if (cpuid != boot_cpuid) { 94 94 flags |= 0x00040000UL; /* "remain halted" */ 95 95 *pflags = flags; 96 - cpu_clear(cpuid, cpu_present_map); 97 - cpu_clear(cpuid, cpu_possible_map); 96 + set_cpu_present(cpuid, false); 97 + set_cpu_possible(cpuid, false); 98 98 halt(); 99 99 } 100 100 #endif ··· 120 120 121 121 #ifdef CONFIG_SMP 122 122 /* Wait for the secondaries to halt. */ 123 - cpu_clear(boot_cpuid, cpu_present_map); 124 - cpu_clear(boot_cpuid, cpu_possible_map); 123 + set_cpu_present(boot_cpuid, false); 124 + set_cpu_possible(boot_cpuid, false); 125 125 while (cpus_weight(cpu_present_map)) 126 126 barrier(); 127 127 #endif
+6 -6
arch/alpha/kernel/smp.c
··· 120 120 smp_callin(void) 121 121 { 122 122 int cpuid = hard_smp_processor_id(); 123 - cpumask_t mask = cpu_online_map; 124 123 125 - if (cpu_test_and_set(cpuid, mask)) { 124 + if (cpu_online(cpuid)) { 126 125 printk("??, cpu 0x%x already present??\n", cpuid); 127 126 BUG(); 128 127 } 128 + set_cpu_online(cpuid, true); 129 129 130 130 /* Turn on machine checks. */ 131 131 wrmces(7); ··· 436 436 ((char *)cpubase + i*hwrpb->processor_size); 437 437 if ((cpu->flags & 0x1cc) == 0x1cc) { 438 438 smp_num_probed++; 439 - cpu_set(i, cpu_possible_map); 440 - cpu_set(i, cpu_present_map); 439 + set_cpu_possible(i, true); 440 + set_cpu_present(i, true); 441 441 cpu->pal_revision = boot_cpu_palrev; 442 442 } 443 443 ··· 470 470 471 471 /* Nothing to do on a UP box, or when told not to. */ 472 472 if (smp_num_probed == 1 || max_cpus == 0) { 473 - cpu_possible_map = cpumask_of_cpu(boot_cpuid); 474 - cpu_present_map = cpumask_of_cpu(boot_cpuid); 473 + init_cpu_possible(cpumask_of(boot_cpuid)); 474 + init_cpu_present(cpumask_of(boot_cpuid)); 475 475 printk(KERN_INFO "SMP mode deactivated.\n"); 476 476 return; 477 477 }