Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 555630 - sys-process/htop - broken CPU accounting for host virtual machines
Summary: sys-process/htop - broken CPU accounting for host virtual machines
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal major (vote)
Assignee: Christian Ruppert (idl0r)
URL: https://github.com/hishamhm/htop/issu...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-22 13:05 UTC by Kerin Millar
Modified: 2020-08-23 19:29 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kerin Millar 2015-07-22 13:05:00 UTC
I have noticed that htop reports CPU usage in a way that is inaccurate and inconsistent with other tools. Among the symptoms I have noticed is that that 100% usage is falsely reported for random cores across each delta. This appears to hold true whatever the value of the --delay parameter.

Someone else noticed and has reported it upstream.

  https://github.com/hishamhm/htop/issues/202

As stated there, the problem was introduced at some point after the 1.0.1 release. I checked the master branch, which is also affected. I intend to bisect this, as time permits.

In the meantime, please restore 1.0.1 to portage and consider revoking the stable keywords for later versions until the issue can be addressed. The justification for this is that htop is very popular and it is of considerable importance that such tools convey proper data.
Comment 1 Kerin Millar 2015-07-24 01:33:43 UTC
Further investigation indicates that this issue might be limited to systems running host virtualization software, although I am still waiting for upstream to confirm. My most recent comment in the upstream issue is quoted beneath.
---

Bisection reveals the following commit as being responsible.

af285d1 Fixes in accounting of guest time when using virtualization

The box that I am testing is a Linux KVM host - not a guest. The option to add guest time to the CPU meter is disabled.

[ ] Add guest time in CPU meter percentage

If I understand this correctly, this commit is either intended to improve the accuracy of CPU accounting in a guest or pertains to the above mentioned option. Either way, it seems to be responsible for inaccurate readings on the host.