]> xenbits.xensource.com Git - libvirt.git/commitdiff
lxc: fuse: Stub out Slab bits in /proc/meminfo
authorCole Robinson <crobinso@redhat.com>
Thu, 21 Jan 2016 18:33:50 +0000 (13:33 -0500)
committerCole Robinson <crobinso@redhat.com>
Fri, 22 Jan 2016 13:32:00 +0000 (08:32 -0500)
'free' on fedora23 wants to use the Slab field for calculated used
memory. The equation is:

used = MemTotal - MemFree - (Cached + Slab) - Buffers

We already set Cached and Buffers to 0, do the same for Slab and its
related values

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

src/lxc/lxc_fuse.c

index 0a1c7dca15e01302e8fb4d7e9e2e128821290f21..1988c195a9b4d1736ff5caf451241e2d34d1301f 100644 (file)
@@ -217,6 +217,12 @@ static int lxcProcReadMeminfo(char *hostpath, virDomainDefPtr def,
             virBufferAsprintf(new_meminfo, "SwapFree:       %8llu kB\n",
                               (meminfo.swaptotal - meminfo.memtotal -
                                meminfo.swapusage + meminfo.memusage));
+        } else if (STREQ(line, "Slab")) {
+            virBufferAsprintf(new_meminfo, "Slab:           %8d kB\n", 0);
+        } else if (STREQ(line, "SReclaimable")) {
+            virBufferAsprintf(new_meminfo, "SReclaimable:   %8d kB\n", 0);
+        } else if (STREQ(line, "SUnreclaim")) {
+            virBufferAsprintf(new_meminfo, "SUnreclaim:     %8d kB\n", 0);
         } else {
             *ptr = ':';
             virBufferAdd(new_meminfo, line, -1);