Skip to contentSkip to conversation

linux/x86: Use cpu_relax() rather than barrier() in smp_call_function()

PATCH New Jan Beulich 1 participant 1 message Dec 6, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux/x86: Use cpu_relax() rather than barrier() in smp_call_function()

Short of getting an explanation for the odd difference to native, make the code match native (and also, in the case of x86-64, __smp_call_function_single()).

As usual, written and tested against 2.6.24-rc3 and made apply against 2.6.18 without further testing.

arch/i386/kernel/smp-xen.c +2 -2
Index: head-2007-11-30/arch/i386/kernel/smp-xen.c
===================================================================
@@ -525,11 +525,11 @@
 
 	/* Wait for response */
 	while (atomic_read(&data.started) != cpus)
-		barrier();
+		cpu_relax();
 
 	if (wait)
 		while (atomic_read(&data.finished) != cpus)
-			barrier();
+			cpu_relax();
 	spin_unlock(&call_lock);
 
 	return 0;
arch/x86_64/kernel/smp-xen.c +0 -8
Index: head-2007-11-30/arch/x86_64/kernel/smp-xen.c
===================================================================
@@ -404,21 +404,13 @@
 
 	/* Wait for response */
 	while (atomic_read(&data.started) != cpus)
-#ifndef CONFIG_XEN
 		cpu_relax();
-#else
-		barrier();
-#endif
 
 	if (!wait)
 		return;
 
 	while (atomic_read(&data.finished) != cpus)
-#ifndef CONFIG_XEN
 		cpu_relax();
-#else
-		barrier();
-#endif
 }
 
 /*