Bug 1357924

Summary: Incorrect memory virtualization in lxc driver
Product: Red Hat Enterprise Linux 7 Reporter: greg.franklin
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.4CC: berrange, dyuan, jdenemar, rbalakri, yisun
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-2.0.0-2.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-03 18:50:37 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 greg.franklin 2016-07-19 15:15:21 UTC
The following bug, fixed in FC23 also affect RHEL7.

https://bugzilla.redhat.com/show_bug.cgi?id=1300781

I tried applying the following patches from FC23 to the libvirt package from RHEL7.2, which successfully fixed the problem.

0009-lxc-fuse-Unindent-meminfo-logic.patch
0010-lxc-fuse-Fix-proc-meminfo-size-calculation.patch
0011-lxc-fuse-Fill-in-MemAvailable-for-proc-meminfo.patch
0012-lxc-fuse-Stub-out-Slab-bits-in-proc-meminfo.patch

Please apply these patches to RHEL7.

Comment 1 Daniel Berrangé 2016-07-19 15:37:04 UTC
The next update of RHEL-7 will include libvirt 2.0.0, and will thus already include these patches.

Comment 4 yisun 2016-09-02 12:31:25 UTC
Try to reproduce on rhel7.2 and reproducible

# rpm -qa | grep libvirt-1
libvirt-1.2.17-13.el7.x86_64
[root@localhost virtmanager]# virt-install --connect lxc:/// --name fedora23 --memory 2048

Starting install...
Creating domain...                                                                                                             |    0 B  00:00:00     
Connected to domain fedora23
Escape character is ^]
sh-4.2# free 
              total        used        free      shared  buff/cache   available
Mem:        2097152     -177480     2095896      153880      178736     4355436
Swap:       8126460          36     8126424


sh-4.2# cat /proc/meminfo | grep -i mem       
MemTotal:        2097152 kB
MemFree:         2095948 kB
MemAvailable:    4355124 kB
Shmem:            153880 kB

Comment 5 yisun 2016-09-02 12:36:32 UTC
Verified on libvirt-2.0.0-6.el7.x86_64 and passed.

# rpm -qa | grep libvirt-2
libvirt-2.0.0-6.el7.x86_64
[root@localhost virtmanager]# virt-install --connect lxc:/// --name fedora23 --memory 2048

Starting install...
Creating domain...                                                                                                             |    0 B  00:00:00     
Connected to domain fedora23
Escape character is ^]
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
sh-4.2# free
              total        used        free      shared  buff/cache   available
Mem:        2097152        1156     2095996      153880           0     2095996
Swap:       8126460          36     8126424
sh-4.2# cat /proc/meminfo | grep -i mem
MemTotal:        2097152 kB
MemFree:         2096004 kB
MemAvailable:    2096004 kB
Shmem:            153880 kB
sh-4.2#

Comment 7 errata-xmlrpc 2016-11-03 18:50:37 UTC
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