Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
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)