]> xenbits.xensource.com Git - xen.git/commit
xen: credit2: implement utilization cap
authorDario Faggioli <dario.faggioli@citrix.com>
Thu, 14 Sep 2017 16:30:36 +0000 (17:30 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Thu, 14 Sep 2017 16:30:36 +0000 (17:30 +0100)
commitad4b3e1e9df34063d1d6afe6fb3b5eb59d67bbad
tree7ebf864dd11841bde9debbf4c6baeb0a58e9680f
parent7c9283ea1f2af5c495709c34991df64841d78e7c
xen: credit2: implement utilization cap

This commit implements the Xen part of the cap mechanism for
Credit2.

A cap is how much, in terms of % of physical CPU time, a domain
can execute at most.

For instance, a domain that must not use more than 1/4 of
one physical CPU, must have a cap of 25%; one that must not
use more than 1+1/2 of physical CPU time, must be given a cap
of 150%.

Caps are per domain, so it is all a domain's vCPUs, cumulatively,
that will be forced to execute no more than the decided amount.

This is implemented by giving each domain a 'budget', and
using a (per-domain again) periodic timer. Values of budget
and 'period' are chosen so that budget/period is equal to the
cap itself.

Budget is burned by the domain's vCPUs, in a similar way to
how credits are.

When a domain runs out of budget, its vCPUs can't run any
longer. They can gain, when the budget is replenishment by
the timer, which event happens once every period.

Blocking the vCPUs because of lack of budget happens by
means of a new (_VPF_parked) pause flag, so that, e.g.,
vcpu_runnable() still works. This is similar to what is
done in sched_rtds.c, as opposed to what happens in
sched_credit.c, where vcpu_pause() and vcpu_unpause()
(which means, among other things, more overhead).

Note that, while adding new fields to csched2_vcpu and
csched2_dom, currently existing members are being moved
around, to achieve best placement inside cache lines.

Note also that xenalyze and tools/xentrace/format are being
updated too.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
tools/xentrace/formats
tools/xentrace/xenalyze.c
xen/common/sched_credit2.c
xen/include/xen/sched.h