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] Fix credit scheduler cap mechanism

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] Fix credit scheduler cap mechanism not to over park VCPUs
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 02 Nov 2006 22:10:16 +0000
Delivery-date: Thu, 02 Nov 2006 21:45:09 -0800
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 Emmanuel Ackaouy <ack@xxxxxxxxxxxxx>
# Node ID 9a4274724794681f31ab1191700203c879bd9387
# Parent  46fad06ab0b3fee5ab6441912f239a82f04bec74
[XEN] Fix credit scheduler cap mechanism not to over park VCPUs
We used to park a capped VCPU when it had ran its fair share, even
if the fair share was below its cap. With this change, make sure
we only park once a VCPU has overrun its actual cap.
We could also try to make the capping mechanism more accurate by
parking and unparking at a finer granularity (currently done on
30ms boundaries) but that'll be for a different time.
Signed-off-by: Emmanuel Ackaouy <ack@xxxxxxxxxxxxx>
---
 xen/common/sched_credit.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff -r 46fad06ab0b3 -r 9a4274724794 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Wed Nov 01 18:48:57 2006 +0000
+++ b/xen/common/sched_credit.c Wed Nov 01 19:44:34 2006 +0000
@@ -721,6 +721,7 @@ csched_acct(void)
     uint32_t weight_left;
     uint32_t credit_fair;
     uint32_t credit_peak;
+    uint32_t credit_cap;
     int credit_balance;
     int credit_xtra;
     int credit;
@@ -751,6 +752,7 @@ csched_acct(void)
     weight_left = weight_total;
     credit_balance = 0;
     credit_xtra = 0;
+    credit_cap = 0U;
 
     list_for_each_safe( iter_sdom, next_sdom, &csched_priv.active_sdom )
     {
@@ -778,13 +780,15 @@ csched_acct(void)
                              (weight_total - 1)
                            ) / weight_total;
         }
+
         if ( sdom->cap != 0U )
         {
-            uint32_t credit_cap;
-            
             credit_cap = ((sdom->cap * CSCHED_CREDITS_PER_ACCT) + 99) / 100;
             if ( credit_cap < credit_peak )
                 credit_peak = credit_cap;
+
+            credit_cap = ( credit_cap + ( sdom->active_vcpu_count - 1 )
+                         ) / sdom->active_vcpu_count;
         }
 
         credit_fair = ( ( credit_total * sdom->weight) + (weight_total - 1)
@@ -840,10 +844,10 @@ csched_acct(void)
              */
             if ( credit < 0 )
             {
-                if ( sdom->cap == 0U )
+                if ( sdom->cap != 0U && credit < -credit_cap )
+                    svc->pri = CSCHED_PRI_TS_PARKED;
+                else
                     svc->pri = CSCHED_PRI_TS_OVER;
-                else
-                    svc->pri = CSCHED_PRI_TS_PARKED;
 
                 if ( credit < -CSCHED_CREDITS_PER_TSLICE )
                 {

_______________________________________________
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] Fix credit scheduler cap mechanism not to over park VCPUs, Xen patchbot-unstable <=