
From: Ashok Raj <ashok.raj@intel.com>

Need to ensure we dont get prempted when we clear ourself from mask when using
clustered mode genapic code.

Signed-off-by: Ashok Raj <ashok.raj@intel.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 arch/x86_64/kernel/genapic_cluster.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN arch/x86_64/kernel/genapic_cluster.c~x86_64fix-cluster-mode-send_ipi_allbutself-to-use-get_cpu-put_cpu arch/x86_64/kernel/genapic_cluster.c
--- devel/arch/x86_64/kernel/genapic_cluster.c~x86_64fix-cluster-mode-send_ipi_allbutself-to-use-get_cpu-put_cpu	2005-08-01 17:12:03.000000000 -0700
+++ devel-akpm/arch/x86_64/kernel/genapic_cluster.c	2005-08-01 17:12:03.000000000 -0700
@@ -72,10 +72,14 @@ static void cluster_send_IPI_mask(cpumas
 static void cluster_send_IPI_allbutself(int vector)
 {
 	cpumask_t mask = cpu_online_map;
-	cpu_clear(smp_processor_id(), mask);
+	int me = get_cpu(); /* Ensure we are not preempted when we clear */
+
+	cpu_clear(me, mask);
 
 	if (!cpus_empty(mask))
 		cluster_send_IPI_mask(mask, vector);
+
+	put_cpu();
 }
 
 static void cluster_send_IPI_all(int vector)
_
