debuggers.hg

changeset 21983:2129cabe5f33

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>
author Keir Fraser <keir.fraser@citrix.com>
date Mon Aug 09 16:37:33 2010 +0100 (2010-08-09)
parents fc29e13f669d
children 07ea977397e0
files xen/common/sched_credit.c
line diff
     1.1 --- a/xen/common/sched_credit.c	Mon Aug 09 16:36:07 2010 +0100
     1.2 +++ b/xen/common/sched_credit.c	Mon Aug 09 16:37:33 2010 +0100
     1.3 @@ -1100,7 +1100,9 @@ csched_acct(void* dummy)
     1.4                  if ( credit > CSCHED_CREDITS_PER_TSLICE )
     1.5                  {
     1.6                      __csched_vcpu_acct_stop_locked(prv, svc);
     1.7 -                    credit = 0;
     1.8 +                    /* Divide credits in half, so that when it starts
     1.9 +                     * accounting again, it starts a little bit "ahead" */
    1.10 +                    credit /= 2;
    1.11                      atomic_set(&svc->credit, credit);
    1.12                  }
    1.13              }