]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
credit: recalculate per-cpupool credits when updating timeslice
authorJuergen Gross <jgross@suse.com>
Tue, 2 Feb 2016 13:03:40 +0000 (14:03 +0100)
committerJan Beulich <jbeulich@suse.com>
Tue, 2 Feb 2016 13:03:40 +0000 (14:03 +0100)
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>
xen/common/sched_credit.c

index 8fbbd54637c1a9540510ab0e0d9a8213114a677c..671bbee0215d4c8fdc3d97ef77d03617635af249 100644 (file)
@@ -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