From: "Jan Beulich" Subject: [PATCH] linux/x86: Use cpu_relax() rather than barrier() in smp_call_function() Date: Thu, 06 Dec 2007 16:00:35 +0000 Message-ID: <47582AB3.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org 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. Signed-off-by: Jan Beulich Index: head-2007-11-30/arch/i386/kernel/smp-xen.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-11-30.orig/arch/i386/kernel/smp-xen.c 2007-12-06 = 14:56:17.000000000 +0100 +++ head-2007-11-30/arch/i386/kernel/smp-xen.c 2007-12-04 09:36:41.0000000= 00 +0100 @@ -525,11 +525,11 @@ =20 /* Wait for response */ while (atomic_read(&data.started) !=3D cpus) - barrier(); + cpu_relax(); =20 if (wait) while (atomic_read(&data.finished) !=3D cpus) - barrier(); + cpu_relax(); spin_unlock(&call_lock); =20 return 0; Index: head-2007-11-30/arch/x86_64/kernel/smp-xen.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- head-2007-11-30.orig/arch/x86_64/kernel/smp-xen.c 2007-12-06 = 14:56:17.000000000 +0100 +++ head-2007-11-30/arch/x86_64/kernel/smp-xen.c 2007-12-04 = 09:38:48.000000000 +0100 @@ -404,21 +404,13 @@ =20 /* Wait for response */ while (atomic_read(&data.started) !=3D cpus) -#ifndef CONFIG_XEN cpu_relax(); -#else - barrier(); -#endif =20 if (!wait) return; =20 while (atomic_read(&data.finished) !=3D cpus) -#ifndef CONFIG_XEN cpu_relax(); -#else - barrier(); -#endif } =20 /*