[PATCH] fix call of smp_processor_id() by XPC while preemptible

From: Dean Nelson <dcn_at_sgi.com>
Date: 2005-07-13 05:30:45
XPC calls smp_processor_id() twice from xpc_setup_infrastructure() with
preemption enabled, which gets flagged if 'DEBUG_PREEMPT=y'. This patch
disables preemption around a now single call to smp_processor_id(). Note
that it doesn't matter if the thread is moved to another processor once
it has the processor ID.

Signed-off-by: Dean Nelson <dcn@sgi.com>


Index: linux-2.6/arch/ia64/sn/kernel/xpc_channel.c
===================================================================
--- linux-2.6.orig/arch/ia64/sn/kernel/xpc_channel.c	2005-07-12 12:09:14.026288661 -0500
+++ linux-2.6/arch/ia64/sn/kernel/xpc_channel.c	2005-07-12 13:23:34.976151339 -0500
@@ -72,7 +72,7 @@
 enum xpc_retval
 xpc_setup_infrastructure(struct xpc_partition *part)
 {
-	int ret;
+	int ret, cpuid;
 	struct timer_list *timer;
 	partid_t partid = XPC_PARTID(part);
 
@@ -223,9 +223,13 @@
 	xpc_vars_part[partid].openclose_args_pa =
 					__pa(part->local_openclose_args);
 	xpc_vars_part[partid].IPI_amo_pa = __pa(part->local_IPI_amo_va);
-	xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(smp_processor_id());
-	xpc_vars_part[partid].IPI_phys_cpuid =
-					cpu_physical_id(smp_processor_id());
+
+	preempt_disable();
+	cpuid = smp_processor_id();
+	preempt_enable();
+	xpc_vars_part[partid].IPI_nasid = cpuid_to_nasid(cpuid);
+	xpc_vars_part[partid].IPI_phys_cpuid = cpu_physical_id(cpuid);
+
 	xpc_vars_part[partid].nchannels = part->nchannels;
 	xpc_vars_part[partid].magic = XPC_VP_MAGIC1;
 
-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Tue Jul 12 15:49:10 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:40 EST