mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
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@eu.citrix.com>
This commit is contained in:
1 parent
5fc9f5ef6c
commit
c92d5f4e0f
1 file changed
+3
-1
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||