RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1099836 - the vcpupin info is not sync with the qemu process after hot-unplug and hot-plug vcpus
Summary: the vcpupin info is not sync with the qemu process after hot-unplug and hot-p...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: libvirt
Version: 6.6
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Ján Tomko
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-05-21 10:22 UTC by Xuesong Zhang
Modified: 2014-06-02 16:01 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-06-02 16:01:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xuesong Zhang 2014-05-21 10:22:26 UTC
Description of problem:
Pin all the vcpus of guest to specific host cpu, hot-unplug some vcpus, hot-plug the vcpus back,
the vcpupin info is not sync with the info of qemu process.

Version-Release number of selected component (if applicable):
libvirt-0.10.2-36.el6.x86_64
qemu-kvm-rhev-0.12.1.2-2.426.el6.x86_64
kernel-2.6.32-466.el6.x86_64

How reproducible:
100%

Steps to Reproduce:
1. prepare one guest, let all the vcpus are pinned to some host cpus, such as the following one:
# virsh dumpxml rhel6.5|grep cpu
  <vcpu placement='static'>4</vcpu>
  <cputune>
    <vcpupin vcpu='0' cpuset='1'/>
    <vcpupin vcpu='1' cpuset='1'/>
    <vcpupin vcpu='2' cpuset='1'/>
    <vcpupin vcpu='3' cpuset='1'/>
  </cputune>

2. start the guest
# virsh start rhel6.5
Domain rhel6.5 started

3. check pid the qemu process, make sure all the vcpus are all pinned to the host cpu.
# ps -ef|grep qemu
qemu      3961     1 75 04:15 ?        00:00:21 /usr/libexec/qemu-kvm -name rhel6.5 
......
# grep Cpus_allowed_list /proc/3961/task/*/status
/proc/3961/task/3961/status:Cpus_allowed_list:        0-3
/proc/3961/task/3982/status:Cpus_allowed_list:        0-3
/proc/3961/task/3983/status:Cpus_allowed_list:        1
/proc/3961/task/3984/status:Cpus_allowed_list:        1
/proc/3961/task/3985/status:Cpus_allowed_list:        1
/proc/3961/task/3986/status:Cpus_allowed_list:        1


4. all the vcpus are all pinned to one host cpu.
# virsh vcpupin rhel6.5
VCPU: CPU Affinity
----------------------------------
   0: 1
   1: 1
   2: 1
   3: 1

5. hot-unplug vcpus
# virsh setvcpus rhel6.5 2

# virsh vcpupin rhel6.5
VCPU: CPU Affinity
----------------------------------
   0: 1
   1: 1


6. hot-plug the vcpus back
# virsh setvcpus rhel6.5 4

7. check the vcpupin info, the new hot-plugged vcpus are pinned to all the host cpus.
# virsh vcpupin rhel6.5
VCPU: CPU Affinity
----------------------------------
   0: 1
   1: 1
   2: 0-3
   3: 0-3

8, check the qemu proces, the new hot-plugged vcpus are still pinned to the host CPU1
# grep Cpus_allowed_list /proc/3961/task/*/status
/proc/3961/task/3961/status:Cpus_allowed_list:        0-3
/proc/3961/task/3982/status:Cpus_allowed_list:        0-3
/proc/3961/task/3983/status:Cpus_allowed_list:        1
/proc/3961/task/3984/status:Cpus_allowed_list:        1
/proc/3961/task/3985/status:Cpus_allowed_list:        1



Actually results:
As step7 and 8, the step7 shows that the new hot-plugged vcpu are pinned to all host cpus, but the step 8 shows that the new hot-plugged vcpu are still pinned to the host CPU1.

Expected results:
The vcpu pinned info should be kept same in step 7 and 8.

Comment 1 Ján Tomko 2014-05-23 12:39:09 UTC
Patch sent upstream:
https://www.redhat.com/archives/libvir-list/2014-May/msg00836.html

Comment 2 Ján Tomko 2014-06-02 16:01:26 UTC
This is just a cosmetic issue (pinning the re-plugged vcpus manually works) and I don't think it's worth fixing.
Upstream QEMU doesn't support hot-unplug of VCPUs, so the proposed patch is not as useful (and it made assumptions about QEMU behavior that might not be true when hot-unplug will be supported).

Also, hot-unplugging pinned vcpus would crash libvirtd until recently (bug 1088165) and vcpu hot-unplug does not seem to be supported in RHEL6: https://bugzilla.redhat.com/show_bug.cgi?id=1088216#c8


Note You need to log in before you can comment on or make changes to this bug.