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-unstable] [XEN] Do not steal work from idle CPUs. T

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Do not steal work from idle CPUs. This can happen
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 17 Sep 2006 17:00:23 +0000
Delivery-date: Sun, 17 Sep 2006 10:01:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID 65b33e64b6421fbc8bcb266ecd65278953b75cb1
# Parent  11645dda144c3c8365dd2a6a64cb5a7d7da01170
[XEN] Do not steal work from idle CPUs. This can happen
if a idle CPU is in the process of waking up.
This fix suggested by Anthony Xu <anthony.xu@xxxxxxxxx> as
it can have a significant boost to HVM performance.
Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>
---
 xen/common/sched_credit.c |   54 +++++++++++++++++++++++-----------------------
 1 files changed, 28 insertions(+), 26 deletions(-)

diff -r 11645dda144c -r 65b33e64b642 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Thu Sep 14 08:19:41 2006 +0100
+++ b/xen/common/sched_credit.c Thu Sep 14 16:01:46 2006 +0100
@@ -987,35 +987,37 @@ csched_load_balance(int cpu, struct csch
          * cause a deadlock if the peer CPU is also load balancing and trying
          * to lock this CPU.
          */
-        if ( spin_trylock(&per_cpu(schedule_data, peer_cpu).schedule_lock) )
-        {
-
-            spc = CSCHED_PCPU(peer_cpu);
-            if ( unlikely(spc == NULL) )
-            {
-                CSCHED_STAT_CRANK(steal_peer_down);
-                speer = NULL;
-            }
-            else
-            {
-                speer = csched_runq_steal(spc, cpu, snext->pri);
-            }
-
-            spin_unlock(&per_cpu(schedule_data, peer_cpu).schedule_lock);
-
-            /* Got one! */
-            if ( speer )
-            {
-                CSCHED_STAT_CRANK(vcpu_migrate);
-                return speer;
-            }
+        if ( !spin_trylock(&per_cpu(schedule_data, peer_cpu).schedule_lock) )
+        {
+            CSCHED_STAT_CRANK(steal_trylock_failed);
+            continue;
+        }
+
+        spc = CSCHED_PCPU(peer_cpu);
+        if ( unlikely(spc == NULL) )
+        {
+            CSCHED_STAT_CRANK(steal_peer_down);
+            speer = NULL;
+        }
+        else if ( is_idle_vcpu(per_cpu(schedule_data, peer_cpu).curr) )
+        {
+            speer = NULL;
         }
         else
         {
-            CSCHED_STAT_CRANK(steal_trylock_failed);
-        }
-    }
-
+            /* Try to steal work from an online non-idle CPU. */
+            speer = csched_runq_steal(spc, cpu, snext->pri);
+        }
+
+        spin_unlock(&per_cpu(schedule_data, peer_cpu).schedule_lock);
+
+        /* Got one? */
+        if ( speer )
+        {
+            CSCHED_STAT_CRANK(vcpu_migrate);
+            return speer;
+        }
+    }
 
     /* Failed to find more important work */
     __runq_remove(snext);

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] Do not steal work from idle CPUs. This can happen, Xen patchbot-unstable <=