On Wed, Jan 17, 2018 at 9:48 AM, Roger Pau Monne <roger....@citrix.com> wrote: > Since VCPUOP_{up/down} already identity pins vCPU hotplug to pCPU > hotplug also pin the vCPUs to the pCPUs in the scheduler. This prevent > vCPU migration and should improve performance. > > While there also use __cpumask_set_cpu instead of cpumask_set_cpu, > there's no need to use the locked variant. > > Signed-off-by: Roger Pau Monné <roger....@citrix.com>
Sorry, I just realized this -- we already have a way to pin a VM 1:1 -- d->is_pinned should do what you want here without having to special-case the pvshim. It seems like something like the attached might be better (compile-tested only). -George
From e6094b9d61b99a3fdbd648d9cefb719436972f88 Mon Sep 17 00:00:00 2001 From: George Dunlap <george.dun...@citrix.com> Date: Wed, 24 Jan 2018 17:58:39 +0000 Subject: [PATCH] x86/shim: Use d->is_pinned to pin the shim Rather than special-casing it inside dom0_setup_vcpu() Signed-off-by: George Dunlap <george.dun...@citrix.com> --- xen/arch/x86/dom0_build.c | 14 +++----------- xen/common/domain.c | 6 +++++- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/xen/arch/x86/dom0_build.c b/xen/arch/x86/dom0_build.c index 555660b853..483cb6cee9 100644 --- a/xen/arch/x86/dom0_build.c +++ b/xen/arch/x86/dom0_build.c @@ -138,17 +138,9 @@ struct vcpu *__init dom0_setup_vcpu(struct domain *d, if ( v ) { - if ( pv_shim ) - { - __cpumask_set_cpu(vcpu_id, v->cpu_hard_affinity); - __cpumask_set_cpu(vcpu_id, v->cpu_soft_affinity); - } - else - { - if ( !d->is_pinned && !dom0_affinity_relaxed ) - cpumask_copy(v->cpu_hard_affinity, &dom0_cpus); - cpumask_copy(v->cpu_soft_affinity, &dom0_cpus); - } + if ( !d->is_pinned && !dom0_affinity_relaxed ) + cpumask_copy(v->cpu_hard_affinity, &dom0_cpus); + cpumask_copy(v->cpu_soft_affinity, &dom0_cpus); } return v; diff --git a/xen/common/domain.c b/xen/common/domain.c index 558318e852..4ce7980550 100644 --- a/xen/common/domain.c +++ b/xen/common/domain.c @@ -318,7 +318,11 @@ struct domain *domain_create(domid_t domid, unsigned int domcr_flags, { if ( hardware_domid < 0 || hardware_domid >= DOMID_FIRST_RESERVED ) panic("The value of hardware_dom must be a valid domain ID"); - d->is_pinned = opt_dom0_vcpus_pin; + d->is_pinned = +#ifdef CONFIG_X86 + pv_shim ? true : +#endif + opt_dom0_vcpus_pin; d->disable_migrate = 1; old_hwdom = hardware_domain; hardware_domain = d; -- 2.15.1
_______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel