]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commit
xen: let vcpu_create() select processor
authorJuergen Gross <jgross@suse.com>
Fri, 27 Sep 2019 07:00:24 +0000 (09:00 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 27 Sep 2019 13:59:19 +0000 (15:59 +0200)
commit8d3c326f6756d1701776d3f10b15e1db6407e85d
tree87c75f5bd4516f0e53fffa6f942f3786060be2b4
parentb218ad9f97f0eb2af75d6bc3fadf68ea3c20bc88
xen: let vcpu_create() select processor

Today there are two distinct scenarios for vcpu_create(): either for
creation of idle-domain vcpus (vcpuid == processor) or for creation of
"normal" domain vcpus (including dom0), where the caller selects the
initial processor on a round-robin scheme of the allowed processors
(allowed being based on cpupool and affinities).

Instead of passing the initial processor to vcpu_create() and passing
on to sched_init_vcpu() let sched_init_vcpu() do the processor
selection. For supporting dom0 vcpu creation use the node_affinity of
the domain as a base for selecting the processors. User domains will
have initially all nodes set, so this is no different behavior compared
to today. In theory this is not guaranteed as vcpus are created only
with XEN_DOMCTL_max_vcpus being called, but this call is going to be
removed in future and the toolstack doesn't call
XEN_DOMCTL_setnodeaffinity before calling XEN_DOMCTL_max_vcpus.

To be able to use const struct domain * make cpupool_domain_cpumask()
take a const domain pointer, too.

A further simplification is possible by having a single function for
creating the dom0 vcpus with vcpu_id > 0 and doing the required pinning
for all vcpus after that. This allows to make sched_set_affinity()
private to schedule.c and switch it to sched_units easily. Note that
this functionality is x86 only.

Signed-off-by: Juergen Gross <jgross@suse.com>
Acked-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com> [x86]
xen/arch/arm/domain_build.c
xen/arch/x86/dom0_build.c
xen/arch/x86/hvm/dom0_build.c
xen/arch/x86/pv/dom0_build.c
xen/common/domain.c
xen/common/domctl.c
xen/common/schedule.c
xen/include/asm-x86/dom0_build.h
xen/include/xen/domain.h
xen/include/xen/sched-if.h
xen/include/xen/sched.h