On Sat, 2019-09-14 at 10:52 +0200, Juergen Gross wrote: > 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. > > Signed-off-by: Juergen Gross > Acked-by: Andrew Cooper > Acked-by: Julien Grall > Reviewed-by: Dario Faggioli Regards -- Dario Faggioli, Ph.D http://about.me/dario.faggioli Virtualization Software Engineer SUSE Labs, SUSE https://www.suse.com/ ------------------------------------------------------------------- <> (Raistlin Majere)