From: George Dunlap <george.dunlap@eu.citrix.com>
To: xen-devel@lists.xensource.com
Cc: george.dunlap@eu.citrix.com
Subject: [PATCH] Credit1: Tweak reset condition
Date: Mon, 9 Aug 2010 12:38:33 +0100 [thread overview]
Message-ID: <1a29b22ef2e9ade8e478.1281353913@gdunlap-desktop> (raw)
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 (shifting
by one bit for more efficiency). 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@eu.citrix.com>
diff -r 6f07d9ac1e7c -r 1a29b22ef2e9 xen/common/sched_credit.c
--- a/xen/common/sched_credit.c Thu Aug 05 14:41:14 2010 +0100
+++ b/xen/common/sched_credit.c Mon Aug 09 12:38:12 2010 +0100
@@ -1069,7 +1069,9 @@
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 >>= 1;
atomic_set(&svc->credit, credit);
}
}
next reply other threads:[~2010-08-09 11:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-09 11:38 George Dunlap [this message]
2010-08-09 12:31 ` [PATCH] Credit1: Tweak reset condition Tim Deegan
2010-08-09 12:49 ` George Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1a29b22ef2e9ade8e478.1281353913@gdunlap-desktop \
--to=george.dunlap@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).