Bug 1244128
Summary: | Setvcpu should inherit the cputune value in cgroups was set before via schedinfo | ||
---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Pei Zhang <pzhang> |
Component: | libvirt | Assignee: | Peter Krempa <pkrempa> |
Status: | CLOSED ERRATA | QA Contact: | Virtualization Bugs <virt-bugs> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 7.2 | CC: | dyuan, lhuang, mzhan, pkrempa, rbalakri, xuzhang |
Target Milestone: | rc | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | libvirt-1.3.2-1.el7 | Doc Type: | Bug Fix |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-11-03 18:19:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Pei Zhang
2015-07-17 08:53:38 UTC
Fixed upstream: commit c6bd15026bc14c7a3a6c9f6d8d9758fdefbf81fe Author: Peter Krempa <pkrempa> Date: Wed Jan 13 17:00:54 2016 +0100 qemu: vcpu: Reuse qemuProcessSetupVcpu in vcpu hotplug Since majority of the steps is shared, the function can be reused to simplify code. Additionally this resolves https://bugzilla.redhat.com/show_bug.cgi?id=1244128 since the cpu bandwidth limiting with cgroups would not be set on the hotplug path. Additionally the code now sets the thread affinity and honors autoCpuset as in the regular startup code path. commit 56971667ee4a5a5f68987be84b3c1461537451de Author: Peter Krempa <pkrempa> Date: Wed Jan 13 16:36:52 2016 +0100 qemu: vcpu: Aggregate code to set vCPU tuning Rather than iterating 3 times for various settings this function aggregates all the code into single place. One of the other advantages is that it can then be reused for properly setting vCPU info on hotplug. With this approach autoCpuset is also used when setting the process affinity rather than just via cgroups. v1.3.1-164-gc6bd150 Verify version: libvirt-2.0.0-2.el7.x86_64 Verify steps : 1. define a guest, set cputune # virsh schedinfo vm1 --set vcpu_quota=1000000000 --config Scheduler : posix cpu_shares : 0 vcpu_period : 0 vcpu_quota : 1000000000 emulator_period: 0 emulator_quota : 0 global_period : 0 global_quota : 0 2. change vcpu numbers, start guest # virsh setvcpus vm1 4 --config # virsh start vm1 Domain vm1 started # virsh dumpxml vm1|grep cputune -A 5 <cputune> <quota>1000000000</quota> ...... # virsh schedinfo vm1 Scheduler : posix cpu_shares : 1024 vcpu_period : 100000 vcpu_quota : 1000000000 emulator_period: 100000 emulator_quota : -1 global_period : 100000 global_quota : -1 3. check values in cgroup # cat /sys/fs/cgroup/cpu\,cpuacct/machine.slice/machine-qemu\\x2d15\\x2dvm1.scope/vcpu0/cpu.cfs_quota_us 1000000000 as above, cat value in vcpu1, vcpu2, vcpu3 4. Using setvcpus to change the number of vcpu # virsh setvcpus vm1 6 --live check in cgroup again : # cat /sys/fs/cgroup/cpu\,cpuacct/machine.slice/machine-qemu\\x2d15\\x2dvm1.scope/vcpu4/cpu.cfs_quota_us 1000000000 # cat /sys/fs/cgroup/cpu\,cpuacct/machine.slice/machine-qemu\\x2d15\\x2dvm1.scope/vcpu5/cpu.cfs_quota_us 1000000000 Now the value can be set on hot plug path, move this bug to verified. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2016-2577.html |