xen/sched: setup dom0 vCPUs affinity only once
authorDario Faggioli <dfaggioli@suse.com>
Mon, 15 Aug 2022 13:33:09 +0000 (15:33 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 15 Aug 2022 13:33:09 +0000 (15:33 +0200)
commit0f7eff5e0303aaf1d17d29fab7a34f0d50a241b0
tree76c7147b237fb23d3521bd7fbfecd23a0b92abdc
parent2a362668cb4ad9a0784c4592968f881d7746ec0f
xen/sched: setup dom0 vCPUs affinity only once

Right now, affinity for dom0 vCPUs is setup in two steps. This is a
problem as, at least in Credit2, unit_insert() sees and uses the
"intermediate" affinity, and place the vCPUs on CPUs where they cannot
be run. And this in turn results in boot hangs, if the "dom0_nodes"
parameter is used.

Fix this by setting up the affinity properly once and for all, in
sched_init_vcpu() called by create_vcpu().

Note that, unless a soft-affinity is explicitly specified for dom0 (by
using the relaxed mode of "dom0_nodes") we set it to the default, which
is all CPUs, instead of computing it basing on hard affinity (if any).
This is because hard and soft affinity should be considered as
independent user controlled properties. In fact, if we dor derive dom0's
soft-affinity from its boot-time hard-affinity, such computed value will
continue to be used even if later the user changes the hard-affinity.
And this could result in the vCPUs behaving differently than what the
user wanted and expects.

Fixes: dafd936dddbd ("Make credit2 the default scheduler")
Reported-by: Olaf Hering <ohering@suse.de>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: c79e4d209be3ed2a6b8e97c35944786ed2a66b94
master date: 2022-08-11 11:46:22 +0200
xen/common/sched/core.c