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] [xen-4.0-testing] x86: Clean up smp_call_function handli

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.0-testing] x86: Clean up smp_call_function handling.
From: Xen patchbot-4.0-testing <patchbot@xxxxxxx>
Date: Wed, 11 May 2011 00:20:10 +0100
Delivery-date: Tue, 10 May 2011 16:20:59 -0700
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1304940024 -3600
# Node ID e91977e7ab3ab097a49c6a4780b330a4f48dac81
# Parent  50066fb241dd39ff8f70cfb56418d3d0b4230496
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 50066fb241dd -r e91977e7ab3a xen/arch/x86/smp.c
--- a/xen/arch/x86/smp.c        Wed Apr 27 13:31:04 2011 +0100
+++ b/xen/arch/x86/smp.c        Mon May 09 12:20:24 2011 +0100
@@ -269,8 +269,6 @@
     void (*func) (void *info);
     void *info;
     int wait;
-    atomic_t started;
-    atomic_t finished;
     cpumask_t selected;
 } call_data;
 
@@ -305,8 +303,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);
 
@@ -317,8 +313,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:
@@ -387,8 +382,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();
@@ -397,12 +393,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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.0-testing] x86: Clean up smp_call_function handling., Xen patchbot-4 . 0-testing <=