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/
Home Products Support Community News


[Xen-changelog] [xen-unstable] Credit1: Tweak reset condition

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] Credit1: Tweak reset condition
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 11 Aug 2010 13:55:45 -0700
Delivery-date: Wed, 11 Aug 2010 13:57:29 -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.fraser@xxxxxxxxxx>
# Date 1281368253 -3600
# Node ID 2129cabe5f3322324587e4d640e27179960717d9
# Parent  fc29e13f669df8a78e9bcd35de56ca07e1c6a637
Credit1: Tweak reset condition

VMs that don't use their full timeslice are guaranteed to flip back
and forth between "active" and "inactive".  If we set credit to 0
when setting "inactive", then when the VM comes back to "active"
again, it will effectively be behind most other vcpus in credit.
This causes the credit1 to effectively discriminate *against*
VMs which use less than their full timeslice.

Instead of setting credit to 0, divide it in half.  This gets rid of
some of the system credit while allowing non-cpu-bound VMs to keep
some priority advantage.

Signed-off-by: George Dunlap <george.dunlap@xxxxxxxxxxxxx>
 xen/common/sched_credit.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -r fc29e13f669d -r 2129cabe5f33 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Mon Aug 09 16:36:07 2010 +0100
+++ b/xen/common/sched_credit.c Mon Aug 09 16:37:33 2010 +0100
@@ -1100,7 +1100,9 @@ csched_acct(void* dummy)
                 if ( credit > CSCHED_CREDITS_PER_TSLICE )
                     __csched_vcpu_acct_stop_locked(prv, svc);
-                    credit = 0;
+                    /* Divide credits in half, so that when it starts
+                     * accounting again, it starts a little bit "ahead" */
+                    credit /= 2;
                     atomic_set(&svc->credit, credit);

Xen-changelog mailing list

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] Credit1: Tweak reset condition, Xen patchbot-unstable <=