All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpumask: Use cpu_*_mask accessors code: alpha
@ 2009-02-07  3:23 Rusty Russell
  2009-02-07 17:12 ` Ivan Kokshaysky
  0 siblings, 1 reply; 2+ messages in thread
From: Rusty Russell @ 2009-02-07  3:23 UTC (permalink / raw)
  To: Richard Henderson
  Cc: linux-kernel, Ivan Kokshaysky, Richard Henderson, FUJITA Tomonori,
	Mike Travis, Ivan Kokshaysky, Richard Henderson, FUJITA Tomonori,
	Mike Travis

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.

(Trivial, but untested!)

Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
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>
---
 arch/alpha/kernel/process.c |    8 ++++----
 arch/alpha/kernel/smp.c     |   11 ++++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/arch/alpha/kernel/process.c b/arch/alpha/kernel/process.c
--- a/arch/alpha/kernel/process.c
+++ b/arch/alpha/kernel/process.c
@@ -93,8 +93,8 @@ common_shutdown_1(void *generic_ptr)
 	if (cpuid != boot_cpuid) {
 		flags |= 0x00040000UL; /* "remain halted" */
 		*pflags = flags;
-		cpu_clear(cpuid, cpu_present_map);
-		cpu_clear(cpuid, cpu_possible_map);
+		set_cpu_present(cpuid, false);
+		set_cpu_possible(cpuid, false);
 		halt();
 	}
 #endif
@@ -120,8 +120,8 @@ common_shutdown_1(void *generic_ptr)
 
 #ifdef CONFIG_SMP
 	/* Wait for the secondaries to halt. */
-	cpu_clear(boot_cpuid, cpu_present_map);
-	cpu_clear(boot_cpuid, cpu_possible_map);
+	set_cpu_present(boot_cpuid, false);
+	set_cpu_possible(boot_cpuid, false);
 	while (cpus_weight(cpu_present_map))
 		barrier();
 #endif
diff --git a/arch/alpha/kernel/smp.c b/arch/alpha/kernel/smp.c
--- a/arch/alpha/kernel/smp.c
+++ b/arch/alpha/kernel/smp.c
@@ -120,12 +120,12 @@ smp_callin(void)
 smp_callin(void)
 {
 	int cpuid = hard_smp_processor_id();
-	cpumask_t mask = cpu_online_map;
 
-	if (cpu_test_and_set(cpuid, mask)) {
+	if (cpu_online(cpuid)) {
 		printk("??, cpu 0x%x already present??\n", cpuid);
 		BUG();
 	}
+	set_cpu_online(cpuid, true);
 
 	/* Turn on machine checks.  */
 	wrmces(7);
@@ -436,8 +436,8 @@ setup_smp(void)
 				((char *)cpubase + i*hwrpb->processor_size);
 			if ((cpu->flags & 0x1cc) == 0x1cc) {
 				smp_num_probed++;
-				cpu_set(i, cpu_possible_map);
-				cpu_set(i, cpu_present_map);
+				set_cpu_possible(i, true);
+				set_cpu_present(i, true);
 				cpu->pal_revision = boot_cpu_palrev;
 			}
 
@@ -470,8 +470,8 @@ smp_prepare_cpus(unsigned int max_cpus)
 
 	/* Nothing to do on a UP box, or when told not to.  */
 	if (smp_num_probed == 1 || max_cpus == 0) {
-		cpu_possible_map = cpumask_of_cpu(boot_cpuid);
-		cpu_present_map = cpumask_of_cpu(boot_cpuid);
+		init_cpu_possible(cpumask_of(boot_cpuid));
+		init_cpu_present(cpumask_of(boot_cpuid));
 		printk(KERN_INFO "SMP mode deactivated.\n");
 		return;
 	}


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] cpumask: Use cpu_*_mask accessors code: alpha
  2009-02-07  3:23 [PATCH] cpumask: Use cpu_*_mask accessors code: alpha Rusty Russell
@ 2009-02-07 17:12 ` Ivan Kokshaysky
  0 siblings, 0 replies; 2+ messages in thread
From: Ivan Kokshaysky @ 2009-02-07 17:12 UTC (permalink / raw)
  To: Rusty Russell
  Cc: Richard Henderson, linux-kernel, FUJITA Tomonori, Mike Travis

On Sat, Feb 07, 2009 at 01:53:11PM +1030, Rusty Russell wrote:
> 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.

Ouch. Shame on me.

> (Trivial, but untested!)

Compiles cleanly, thanks.

Acked-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>

Ivan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-02-07 17:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-07  3:23 [PATCH] cpumask: Use cpu_*_mask accessors code: alpha Rusty Russell
2009-02-07 17:12 ` Ivan Kokshaysky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.