]> git.ipfire.org Git - thirdparty/libvirt.git/commit
cgroup: Use system reported "unlimited" value for comparison
authorViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
Tue, 6 Dec 2016 12:03:29 +0000 (13:03 +0100)
committerMartin Kletzander <mkletzan@redhat.com>
Tue, 6 Dec 2016 15:25:20 +0000 (16:25 +0100)
commitac8ac9e0526b05a6a619dd8792597f00d59c8e92
tree45f5e22b75a8676e25d76725a78549299a987d0f
parent22f7ceb695ae98a3c090c34e3489305de911c8d2
cgroup: Use system reported "unlimited" value for comparison

With kernel 3.18 (since commit 3e32cb2e0a12b6915056ff04601cf1bb9b44f967)
the "unlimited" value for cgroup memory limits has changed once again as
its byte value is now computed from a page counter.
The new "unlimited" value reported by the cgroup fs is therefore 2**51-1
pages which is (VIR_DOMAIN_MEMORY_PARAM_UNLIMITED - 3072). This results
e.g. in virsh memtune displaying 9007199254740988 instead of unlimited
for the limits.

This patch uses the value of memory.limit_in_bytes from the cgroup
memory root which is the system's "real" unlimited value for comparison.

See also libvirt commit 231656bbeb9e4d3bedc44362784c35eee21cf0f4 for the
history for kernel 3.12 and before.

Signed-off-by: Viktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
src/util/vircgroup.c