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 2/3] _csched_cpu_pick(): don't write idle bias more t

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH 2/3] _csched_cpu_pick(): don't write idle bias more than once
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Mon, 14 Mar 2011 17:04:50 +0000
Delivery-date: Mon, 14 Mar 2011 10:13:26 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
For the bias to be really meaningful, it should be updated onbly when
the CPU selected will indeed be returned (and hence used for placing
the vCPU in question).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -464,6 +464,7 @@ _csched_cpu_pick(const struct scheduler 
     cpumask_t cpus;
     cpumask_t idlers;
     cpumask_t *online;
+    struct csched_pcpu *spc = NULL;
     int cpu;
 
     /*
@@ -531,9 +532,8 @@ _csched_cpu_pick(const struct scheduler 
                   && (weight_cpu * migrate_factor < weight_nxt) ) )
         {
             cpus_and(nxt_idlers, cpus, nxt_idlers);
-            cpu = cycle_cpu(CSCHED_PCPU(nxt)->idle_bias, nxt_idlers);
-            if ( commit )
-               CSCHED_PCPU(nxt)->idle_bias = cpu;
+            spc = CSCHED_PCPU(nxt);
+            cpu = cycle_cpu(spc->idle_bias, nxt_idlers);
             cpus_andnot(cpus, cpus, per_cpu(cpu_sibling_map, cpu));
         }
         else
@@ -542,6 +542,9 @@ _csched_cpu_pick(const struct scheduler 
         }
     }
 
+    if ( commit && spc )
+       spc->idle_bias = cpu;
+
     return cpu;
 }
 



Attachment: csched-pick-adjust.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH 2/3] _csched_cpu_pick(): don't write idle bias more than once, Jan Beulich <=