Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > 6baf24ee0100410726269e474b93d1bc > files > 38

xen-4.5.2-1.5.mga5.src.rpm

From 836dc18a378464e3e89a6b6e01c4a24a21f0316b Mon Sep 17 00:00:00 2001
From: Juergen Gross <jgross@suse.com>
Date: Wed, 17 Feb 2016 16:48:37 +0100
Subject: [PATCH 39/43] credit: recalculate per-cpupool credits when updating
 timeslice

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>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
master commit: ffc342fbb060cd753fc3a5f6fb6f550dd29a2637
master date: 2016-02-02 14:03:40 +0100
---
 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 0e61a0e..54fd830 100644
--- a/xen/common/sched_credit.c
+++ b/xen/common/sched_credit.c
@@ -1071,6 +1071,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.7.2