xen: sched/credit1: make vcpu_migration_delay per-cpupool
authorDario Faggioli <dfaggioli@suse.com>
Thu, 15 Mar 2018 17:51:23 +0000 (18:51 +0100)
committerGeorge Dunlap <george.dunlap@citrix.com>
Wed, 21 Mar 2018 15:37:52 +0000 (15:37 +0000)
commita4f2ddefa4f9ceccfcadf6ebc4de044acadd9cd3
treec037fa11ae965a25eb90813de52e1a06157a77aa
parent18596903e9f1362826b71f69008e5c839cc756b5
xen: sched/credit1: make vcpu_migration_delay per-cpupool

Right now, vCPU migration delay is controlled by
the vcpu_migration_delay boot parameter. This means
the same value will always be used for every instance
of Credit1, in any cpupool that will be created.

Also, in order to get and set such value, a special
purpose libxc interface is defined, and used by the
xenpm tool. And this is problematic if Xen is built
without Credit1 support.

This commit adds a vcpu_migr_delay field inside
struct csched_private, so that we can get/set the
migration delay indepently for each Credit1 instance,
in different cpupools.

Getting and setting now happens via XEN_SYSCTL_SCHEDOP_*,
which is much better suited for this parameter.

The value of the boot time parameter is used for
initializing the vcpu_migr_delay field of the private
structure of all the scheduler instances, when they're
created.

While there, save reading NOW() and doing any s_time_t
operation, when the migration delay of a scheduler is
zero (as it is, by default), in
__csched_vcpu_is_cache_hot().

Finally, note that, from this commit on, using `xenpm
{set,get}-vcpu-migration-delay' will have no effect
any longer. A subsequent commit will re-enable it, for
the sake of backwards-compatibility.

Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: George Dunlap <george.dunlap@citrix.com>
xen/common/sched_credit.c
xen/include/public/sysctl.h