xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Dario Faggioli <dario.faggioli@citrix.com>
To: Anshul Makkar <anshul.makkar@citrix.com>, xen-devel@lists.xen.org
Cc: george.dunlap@eu.citrix.com
Subject: Re: [PATCH -v3 1/1] ratelimit: Implement rate limit for credit2 scheduler Rate limit assures that a vcpu will execute for a minimum amount of time before being put at the back of a queue or being preempted by higher priority thread.
Date: Tue, 26 Jul 2016 18:21:36 +0200	[thread overview]
Message-ID: <1469550096.32102.53.camel@citrix.com> (raw)
In-Reply-To: <1469463147-4798-1-git-send-email-anshul.makkar@citrix.com>


[-- Attachment #1.1: Type: text/plain, Size: 2410 bytes --]

On Mon, 2016-07-25 at 17:12 +0100, Anshul Makkar wrote:
> It introduces context-switch rate-limiting. The patch enables the VM
> to batch
> its work and prevents the system from spending most of its time in
> context
> switches because of a VM that is waking/sleeping at high rate.
> 
> ratelimit can be disabled by setting it to 0.
> 
Thanks Anshul. I've looked at the patch, and it seemed all right to me.

I decided to build and test it, and I've seem something that I found
weird.

But first of all, one thing that I'm sorry I'm mentioning now
(especially considering it was quite evident! :-/).

The subject, which will become the "title" of the commit, is way too
long. That must be a very concise headline of what the patch is about,
and should also have tags, specifying what areas of the codebase are
affected. So what do you think of this:

  xen: credit2: implement context switch rate-limiting.

On a more technical side, I think that...

> @@ -2116,9 +2147,22 @@ csched2_runtime(const struct scheduler *ops,
> int cpu, struct csched2_vcpu *snext
>       * 1) Run until snext's credit will be 0
>       * 2) But if someone is waiting, run until snext's credit is
> equal
>       * to his
> -     * 3) But never run longer than MAX_TIMER or shorter than
> MIN_TIMER.
> +     * 3) But never run longer than MAX_TIMER or shorter than
> MIN_TIMER or
> +     * the ratelimit time.
>       */
>  
> +    /* Calculate mintime */
> +    min_time = CSCHED2_MIN_TIMER;
> +    if ( prv->ratelimit_us )
> +    {
> +        s_time_t ratelimit_min = prv->ratelimit_us;
>
... this should be:

 s_time_t ratelimit_min = MICROSECS(prv->ratelimit_us);

I realized that by looking at traces and seeing entries for which
CSCHED2_MIN_TIMER was being returned, even if I had set
sched_ratelimit_us to a value greater than that.

I think the rest of the code is ok, and this is the only issue... but
I'll make the change above here locally and continue my testing, and
let you know if I find anything else.

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)


[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

[-- Attachment #2: Type: text/plain, Size: 127 bytes --]

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

  reply	other threads:[~2016-07-26 16:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-25 16:12 [PATCH -v3 1/1] ratelimit: Implement rate limit for credit2 scheduler Rate limit assures that a vcpu will execute for a minimum amount of time before being put at the back of a queue or being preempted by higher priority thread Anshul Makkar
2016-07-26 16:21 ` Dario Faggioli [this message]
2016-08-03 10:16   ` George Dunlap
2016-08-03 11:43     ` anshul makkar
2016-08-03 12:22       ` 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=1469550096.32102.53.camel@citrix.com \
    --to=dario.faggioli@citrix.com \
    --cc=anshul.makkar@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=xen-devel@lists.xen.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).