[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-4.1-testing] x86: Clean up smp_call_function handling.



# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1304939794 -3600
# Node ID b2c493776b0622b54039da9da8e64895fa7614fb
# Parent  cd51edb56b173355e06abe5d37570a90e2016052
x86: Clean up smp_call_function handling.

We don't need so many communication fields between caller and
handler.

Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset:   23285:a7ac0a0170b0
xen-unstable date:        Sun May 01 09:32:48 2011 +0100
---


diff -r cd51edb56b17 -r b2c493776b06 xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        Wed Apr 27 13:38:08 2011 +0100
+++ b/xen/arch/x86/smp.c        Mon May 09 12:16:34 2011 +0100
@@ -280,8 +280,6 @@
     void (*func) (void *info);
     void *info;
     int wait;
-    atomic_t started;
-    atomic_t finished;
     cpumask_t selected;
 } call_data;
 
@@ -316,8 +314,6 @@
     call_data.func = func;
     call_data.info = info;
     call_data.wait = wait;
-    atomic_set(&call_data.started, 0);
-    atomic_set(&call_data.finished, 0);
 
     send_IPI_mask(&call_data.selected, CALL_FUNCTION_VECTOR);
 
@@ -328,8 +324,7 @@
         local_irq_enable();
     }
 
-    while ( atomic_read(wait ? &call_data.finished : &call_data.started)
-            != nr_cpus )
+    while ( !cpus_empty(call_data.selected) )
         cpu_relax();
 
  out:
@@ -397,8 +392,9 @@
 {
     void (*func)(void *info) = call_data.func;
     void *info = call_data.info;
+    unsigned int cpu = smp_processor_id();
 
-    if ( !cpu_isset(smp_processor_id(), call_data.selected) )
+    if ( !cpu_isset(cpu, call_data.selected) )
         return;
 
     irq_enter();
@@ -407,12 +403,12 @@
     {
         (*func)(info);
         mb();
-        atomic_inc(&call_data.finished);
+        cpu_clear(cpu, call_data.selected);
     }
     else
     {
         mb();
-        atomic_inc(&call_data.started);
+        cpu_clear(cpu, call_data.selected);
         (*func)(info);
     }
 

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.