why shared cpu policy schedule all vcpu on same host cpu?
I'm using extra specs of flavor to assign host resource to my VM on openstack mitaka, it works well when I want to pin cpus to my VM by using "hw:cpu_policy=dedicated" in flavor, but what shocks me is that if I don't pin cpus or use "hw:cpu_policy=shared", all vcpus always use or be scheduled on the same host cpu even though its cpu-set has other cpus to choose, for exmaple:
virsh vcpuinfo instance-000000df
VCPU: 0 CPU: 3 State: running CPU time: 2.9s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 1 CPU: 3 State: running CPU time: 0.3s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 2 CPU: 3 State: running CPU time: 0.5s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 3 CPU: 3 State: running CPU time: 0.2s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 4 CPU: 3 State: running CPU time: 0.3s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 5 CPU: 3 State: running CPU time: 0.2s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 6 CPU: 3 State: running CPU time: 0.3s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
VCPU: 7 CPU: 3 State: running CPU time: 0.2s CPU Affinity: ---yyyyyyy-------------yyyyyyy----------
you can see that all vcpus has CPU affinity which has more than one CPU, but they are all scheduled on the same and first CPU of CPU affinity group, the corresponding xml of libevirt is:
<vcpu placement="static">8</vcpu> <cputune> <vcpupin vcpu="0" cpuset="3-9,23-29"/> <vcpupin vcpu="1" cpuset="3-9,23-29"/> <vcpupin vcpu="2" cpuset="3-9,23-29"/> <vcpupin vcpu="3" cpuset="3-9,23-29"/> <vcpupin vcpu="4" cpuset="3-9,23-29"/> <vcpupin vcpu="5" cpuset="3-9,23-29"/> <vcpupin vcpu="6" cpuset="3-9,23-29"/> <vcpupin vcpu="7" cpuset="3-9,23-29"/> <emulatorpin cpuset="3-9,23-29"/> </cputune>
is this expected behavior? But I saw the openstack official guide introduce that hw:cpu_policy=shared will make vcpus freely floating across cpu-set. Or I'm not using it right?
best regards.