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-changelog

[Xen-changelog] Fix smp_call_function race (introduced a couple of days

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix smp_call_function race (introduced a couple of days ago).
From: BitKeeper Bot <riel@xxxxxxxxxxx>
Date: Sun, 05 Jun 2005 14:56:51 +0000
Delivery-date: Sun, 05 Jun 2005 15:02:18 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: Xen Development List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
ChangeSet 1.1677, 2005/06/05 15:56:51+01:00, kaf24@xxxxxxxxxxxxxxxxxxxx

        Fix smp_call_function race (introduced a couple of days ago).
        Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>



 smp.c |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)


diff -Nru a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        2005-06-05 11:03:13 -04:00
+++ b/xen/arch/x86/smp.c        2005-06-05 11:03:13 -04:00
@@ -272,6 +272,7 @@
 struct call_data_struct {
     void (*func) (void *info);
     void *info;
+    int wait;
     atomic_t started;
     atomic_t finished;
 };
@@ -299,6 +300,7 @@
 
     data.func = func;
     data.info = info;
+    data.wait = wait;
     atomic_set(&data.started, 0);
     atomic_set(&data.finished, 0);
 
@@ -345,17 +347,22 @@
 
 asmlinkage void smp_call_function_interrupt(void)
 {
-    void (*func) (void *info) = call_data->func;
+    void (*func)(void *info) = call_data->func;
     void *info = call_data->info;
 
     ack_APIC_irq();
     perfc_incrc(ipis);
 
-    mb();
-    atomic_inc(&call_data->started);
-
-    (*func)(info);
-
-    mb();
-    atomic_inc(&call_data->finished);
+    if ( call_data->wait )
+    {
+        (*func)(info);
+        mb();
+        atomic_inc(&call_data->finished);
+    }
+    else
+    {
+        mb();
+        atomic_inc(&call_data->started);
+        (*func)(info);
+    }
 }

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix smp_call_function race (introduced a couple of days ago)., BitKeeper Bot <=