-
Bug
-
Resolution: Won't Do
-
Undefined
-
None
-
rhel-8.8.0
-
None
-
Moderate
-
rhel-sst-virtualization
-
ssg_virtualization
-
None
-
False
-
-
None
-
None
-
None
-
None
-
If docs needed, set a value
-
-
x86_64
-
None
Description of problem:Make the host cpu offline, check the cpu affinity with virsh vcpuinfo and virsh cpupin. Then make the host cpu online and check cpu affinity again, find cpu affinity from vcpuinfo remains same as cpu offline, even destroy and start the guest again the cpu affinity info from vcpuinfo remains unchanged. But cpu affinity from virsh vcpupin would vary according to cpu online status.
Version-Release number of selected component (if applicable):
- rpm -q libvirt qemu-kvm
libvirt-8.0.0-19.module+el8.8.0+18453+e0bf0d1d.x86_64
qemu-kvm-6.2.0-32.module+el8.8.0+18361+9f407f6e.x86_64
How reproducible:
100%
Steps to Reproduce:
1 Start a guest vm with below vcpu setting:
<vcpu placement='static'>2</vcpu>
2 Check the cpu affinity with vcpuinfo and vcpupin
- virsh vcpuinfo vm1
VCPU: 0
CPU: 12
State: running
CPU time: 19.7s
CPU Affinity: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
VCPU: 1
CPU: 44
State: running
CPU time: 13.6s
CPU Affinity: yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
- virsh vcpupin vm1
VCPU CPU Affinity
----------------------
0 0-47
1 0-47
3 Make one host cpu offline
- echo 0 > /sys/devices/system/cpu/cpu2/online
4 Check the cpu affinity with vcpuinfo and vcpupin again
- virsh vcpuinfo vm1
VCPU: 0
CPU: 12
State: running
CPU time: 19.8s
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
VCPU: 1
CPU: 44
State: running
CPU time: 13.7s
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
- virsh vcpupin vm1
VCPU CPU Affinity
----------------------
0 0-1,3-47
1 0-1,3-47
5 Check the cgroup cpuset.cpus
- cat /sys/fs/cgroup/cpuset/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d1
x2dvm1.scope/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d1
x2dvm1.scope/libvirt/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d1
x2dvm1.scope/libvirt/emulator/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d1
x2dvm1.scope/libvirt/vcpu*/cpuset.cpus
0-1,3-47
0-1,3-47
6 Make the cpu back online
- echo 1 > /sys/devices/system/cpu/cpu2/online
7 Check the cpu affinity with vcpuinfo and vcpupin
- virsh vcpuinfo vm1
VCPU: 0
CPU: 12
State: running
CPU time: 19.8s
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
VCPU: 1
CPU: 44
State: running
CPU time: 13.8s
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
- virsh vcpupin vm1
VCPU CPU Affinity
----------------------
0 0-47
1 0-47
7 Destroy and start the guest
- virsh destroy vm1
Domain 'vm1' destroyed
- virsh start vm1
Domain 'vm1' started
8 Check the cpu affinity with vcpuinfo and vcpupin
- virsh vcpuinfo vm1
VCPU: 0
CPU: 35
State: running
CPU time: 1.8s
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
VCPU: 1
CPU: 9
State: running
CPU Affinity: yy-yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
- virsh vcpupin vm1
VCPU CPU Affinity
----------------------
0 0-47
1 0-47
9 Check cgroup cpuset.cpus
- cat /sys/fs/cgroup/cpuset/cpuset.cpus
0-47 - cat /sys/fs/cgroup/cpuset/machine.slice/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d2
x2dvm1.scope/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d2
x2dvm1.scope/libvirt/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d2
x2dvm1.scope/libvirt/emulator/cpuset.cpus
0-1,3-47 - cat /sys/fs/cgroup/cpuset/machine.slice/machine-qemu\\x2d2
x2dvm1.scope/libvirt/vcpu*/cpuset.cpus
0-1,3-47
0-1,3-47
Actual results:
Cpu affinity info from vcpuinfo and vcpupin are different after cpu back online
Expected results:
Cpu affinity info from vcpuinfo and vcpupin should be same
Additional info:
1 This issue can not be reproduced on rhel9.2 and rhel9.3(cgroupv2)
2 virsh emulatorpin has the same behavior with vcpupin
- external trackers