Bug 1569678
Summary: | virsh capabilities reports invalid values for 4K pages | |||
---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Mark Jones <marjones> | |
Component: | libvirt | Assignee: | Michal Privoznik <mprivozn> | |
Status: | CLOSED ERRATA | QA Contact: | Jing Qi <jinqi> | |
Severity: | high | Docs Contact: | ||
Priority: | high | |||
Version: | 7.4 | CC: | chhu, dyuan, jdenemar, jherrman, lmen, marjones, mkalinin, mtessun, tbonds, xuzhang, yalzhang | |
Target Milestone: | rc | Keywords: | Upstream, ZStream | |
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | libvirt-4.3.0-1.el7 | Doc Type: | Bug Fix | |
Doc Text: |
The "virsh capabilities" command previously displayed an inaccurate number of 4 KiB memory pages on systems with very large amounts of memory. This update optimizes the memory diagnostic mechanism to ensure memory page numbers are displayed correctly on such systems.
|
Story Points: | --- | |
Clone Of: | ||||
: | 1582416 1582418 (view as bug list) | Environment: | ||
Last Closed: | 2018-10-30 09:55:31 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: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1519540, 1582416, 1582418, 1625119, 1625120, 1625122 |
Comment 3
Luyao Huang
2018-04-23 07:24:27 UTC
The problem is that page_size and page_avail is unsigned int, and the result is still unsigned int, this is a multiplication overflow. Patch proposed on the upstream list: https://www.redhat.com/archives/libvir-list/2018-April/msg02229.html I've pushed the patch upstream: commit 31daccf5a550e7ede35532004006b34ba5c5b92e Author: Michal Privoznik <mprivozn> AuthorDate: Mon Apr 23 16:36:53 2018 +0200 Commit: Michal Privoznik <mprivozn> CommitDate: Tue Apr 24 11:02:28 2018 +0200 virNumaGetHugePageInfo: Return page_avail and page_free as ULL https://bugzilla.redhat.com/show_bug.cgi?id=1569678 On some large systems (with ~400GB of RAM) it is possible for unsigned int to overflow in which case we report invalid number of 4K pages pool size. Switch to unsigned long long. We hit overflow in virNumaGetPages when doing: huge_page_sum += 1024 * page_size * page_avail; because although 'huge_page_sum' is an unsigned long long, the page_size and page_avail are both unsigned int, so the promotion to unsigned long long doesn't happen until the sum has been calculated, by which time we've already overflowed. Turning page_avail into a unsigned long long is not strictly needed until we need ability to represent more than 2^32 4k pages, which equates to 16 TB of RAM. That's not outside the realm of possibility, so makes sense that we change it to unsigned long long to avoid future problems. Signed-off-by: Michal Privoznik <mprivozn> Reviewed-by: Daniel P. Berrangé <berrange> v4.2.0-456-g31daccf5a5 Verified as described in bug 1582418 & 1582416. 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://access.redhat.com/errata/RHSA-2018:3113 |