Hide Forgot
Description of problem: Guest CPU usage is collected from the VM process CPU usage. If you have a multi-core host the CPU usage can be higher than 100%. Current the VM CPU samples are truncated at 100% and don't reflect the CPUs usage on the guest level (VM's CPU Usage = Host's CPU Usage / VM's CPUs). The result should still truncated at 100% to avoid overhead that will return more than 100%, but be divided by VM's CPUs to reflect the correct stats. Version-Release number of selected component (if applicable): vdsm-4.9-112.3.el6.x86_64 How reproducible: Always Steps to Reproduce: 1. Run VM with more than one core. 2. Load it beyond 100% CPU Usage. 3. Check Guest CPU Usage. Actual results: Guest sees less usage than reported. Expected results: Reported result should be close to the one reported on the guest.
I'm sorry to have mislead you: a closer review of the code shows that vdsm reports cpu consumption of qemu processes similarly to top(1). For mutli-vcpu VMs, cpuUser+cpuSys may exceed 100% considerably. jiffies = (vms1.pidcpu.user - vms0.pidcpu.user) % 2**32 stats['cpuUser'] = jiffies / interval cpuUser is the jiffies per second, allocated to the qemu-kvm process (each host cpu provides 100 jiffies per second)