WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] linux/x86: Use cpu_relax() rather than barrier() in

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] linux/x86: Use cpu_relax() rather than barrier() in smp_call_function()
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Thu, 06 Dec 2007 16:00:35 +0000
Delivery-date: Thu, 06 Dec 2007 08:00:41 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 <jbeulich@xxxxxxxxxx>

Index: head-2007-11-30/arch/i386/kernel/smp-xen.c
===================================================================
--- 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.000000000 
+0100
@@ -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;
Index: head-2007-11-30/arch/x86_64/kernel/smp-xen.c
===================================================================
--- 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 @@
 
        /* 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
 }
 
 /*




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] linux/x86: Use cpu_relax() rather than barrier() in smp_call_function(), Jan Beulich <=