]> xenbits.xensource.com Git - xen.git/commit
xen: credit2: only reset credit on reset condition
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 30 Sep 2016 02:53:46 +0000 (04:53 +0200)
committerGeorge Dunlap <george.dunlap@citrix.com>
Fri, 30 Sep 2016 13:46:36 +0000 (14:46 +0100)
commit5e4b4199667b989a931b2028dec621d14be032ad
tree65c128965aab019976b061096aa55f5b82a8b72f
parent069cf39fb1715bc8f43dc3f9b332fe6b6b778611
xen: credit2: only reset credit on reset condition

The condition for a Credit2 scheduling epoch coming to an
end is that the vcpu at the front of the runqueue has negative
credits. However, it is possible, that runq_candidate() does
not actually return to the scheduler the first vcpu in the
runqueue (e.g., because such vcpu can't run on the cpu that
is going through the scheduler, because of hard-affinity).

If that happens, we should not trigger a credit reset, or we
risk altering the lenght of a scheduler epoch, wrt what the
original idea of the algorithm was.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit2.c