xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xen.org, jbeulich@suse.com,
	alan.robinson@ts.fujitsu.com, george.dunlap@eu.citrix.com,
	dario.faggioli@citrix.com
Cc: Juergen Gross <jgross@suse.com>
Subject: [PATCH v2 2/2] xen: recalculate per-cpupool credits when updating timeslice
Date: Tue,  2 Feb 2016 12:29:42 +0100	[thread overview]
Message-ID: <1454412582-3263-3-git-send-email-jgross@suse.com> (raw)
In-Reply-To: <1454412582-3263-1-git-send-email-jgross@suse.com>

When modifying the timeslice of the credit scheduler in a cpupool the
cpupool global credit value (n_cpus * credits_per_tslice) isn't
recalculated. This will lead to wrong scheduling decisions later.

Do the recalculation when updating the timeslice.

Signed-off-by: Juergen Gross <jgross@suse.com>
Tested-by: Alan.Robinson <alan.robinson@ts.fujitsu.com>
---
 xen/common/sched_credit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/xen/common/sched_credit.c b/xen/common/sched_credit.c
index 8fbbd54..671bbee 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1092,6 +1092,7 @@ __csched_set_tslice(struct csched_private *prv, unsigned timeslice)
         prv->ticks_per_tslice = 1;
     prv->tick_period_us = prv->tslice_ms * 1000 / prv->ticks_per_tslice;
     prv->credits_per_tslice = CSCHED_CREDITS_PER_MSEC * prv->tslice_ms;
+    prv->credit = prv->credits_per_tslice * prv->ncpus;
 }
 
 static int
-- 
2.6.2

  parent reply	other threads:[~2016-02-02 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 11:29 [PATCH v2 0/2] xen: correct changing credit scheduler's timeslice Juergen Gross
2016-02-02 11:29 ` [PATCH v2 1/2] xen: update timeslice under lock Juergen Gross
2016-02-02 11:29 ` Juergen Gross [this message]
2016-02-02 12:14 ` [PATCH v2 0/2] xen: correct changing credit scheduler's timeslice 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=1454412582-3263-3-git-send-email-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=alan.robinson@ts.fujitsu.com \
    --cc=dario.faggioli@citrix.com \
    --cc=george.dunlap@eu.citrix.com \
    --cc=jbeulich@suse.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).