xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: George Dunlap <george.dunlap@citrix.com>
To: Dario Faggioli <dario.faggioli@citrix.com>,
	xen-devel@lists.xenproject.org
Cc: Wei Liu <wei.liu2@citrix.com>,
	George Dunlap <george.dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Ian Jackson <ian.jackson@eu.citrix.com>,
	Anshul Makkar <anshulmakkar@gmail.com>,
	Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2 1/4] xen: credit2: implement utilization cap
Date: Thu, 14 Sep 2017 17:20:25 +0100	[thread overview]
Message-ID: <c211e7aa-23f3-8b88-5470-f4509eedf6ea@citrix.com> (raw)
In-Reply-To: <150307145322.6642.8867195330176310748.stgit@Solace.fritz.box>

On 08/18/2017 04:50 PM, Dario Faggioli wrote:
> 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>

Looks good, with one minor nit...


> +        /*
> +         * NB: we give the whole remaining budget a domain has, to the first
> +         * vCPU that comes here and asks for it. This means that, in a domain
> +         * with a cap, only 1 vCPU is able to run, at any given time.
> +         * /THIS IS GOING TO CHANGE/ in subsequent patches, toward something
> +         * that allows much better fairness and parallelism. Proceeding in
> +         * two steps, is for making things easy to understand, when looking
> +         * at the signle commits.

*single

But I can fix that up on check-in.

Reviewed-by: George Dunlap <george.dunlap@citrix.com>

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-09-14 16:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-18 15:50 [PATCH v2 0/4] xen/tools: Credit2: implement caps Dario Faggioli
2017-08-18 15:50 ` [PATCH v2 1/4] xen: credit2: implement utilization cap Dario Faggioli
2017-08-24 19:42   ` Anshul Makkar
2017-09-05 17:53     ` Dario Faggioli
2017-09-14 16:20   ` George Dunlap [this message]
2017-09-14 16:32     ` George Dunlap
2017-08-18 15:51 ` [PATCH v2 2/4] xen: credit2: allow to set and get " Dario Faggioli
2017-09-14 16:21   ` George Dunlap
2017-08-18 15:51 ` [PATCH v2 3/4] xen: credit2: improve distribution of budget (for domains with caps) Dario Faggioli
2017-08-18 15:51 ` [PATCH v2 4/4] libxl/xl: allow to get and set cap on Credit2 Dario Faggioli

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=c211e7aa-23f3-8b88-5470-f4509eedf6ea@citrix.com \
    --to=george.dunlap@citrix.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anshulmakkar@gmail.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=jbeulich@suse.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /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).