The following pull request was submitted through Github. It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7248
This e-mail was sent by the LXC bot, direct replies will not reach the author unless they happen to be subscribed to this list. === Description (from pull-request) === Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From f35ed9e23e29153a276ba6ca4465b3d50c660ba4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com> Date: Thu, 23 Apr 2020 09:49:19 -0400 Subject: [PATCH] lxd/cgroup: Fix memory controller detection MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber <stgra...@ubuntu.com> --- lxd/cgroup/init.go | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lxd/cgroup/init.go b/lxd/cgroup/init.go index 6d04d33073..335d91e820 100644 --- a/lxd/cgroup/init.go +++ b/lxd/cgroup/init.go @@ -387,8 +387,22 @@ func init() { } val, ok = cgControllers["memory"] - if ok && val == V1 && shared.PathExists("/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes") { - cgControllers["memory.memsw.limit_in_bytes"] = V2 + if ok && val == V1 { + if shared.PathExists("/sys/fs/cgroup/memory/memory.max_usage_in_bytes") { + cgControllers["memory.max_usage_in_bytes"] = V1 + } + + if shared.PathExists("/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes") { + cgControllers["memory.memsw.limit_in_bytes"] = V1 + } + + if shared.PathExists("/sys/fs/cgroup/memory/memory.memsw.usage_in_bytes") { + cgControllers["memory.memsw.usage_in_bytes"] = V1 + } + + if shared.PathExists("/sys/fs/cgroup/memory/memory.memsw.max_usage_in_bytes") { + cgControllers["memory.memsw.max_usage_in_bytes"] = V1 + } } val, ok = cgControllers["memory"]
_______________________________________________ lxc-devel mailing list lxc-devel@lists.linuxcontainers.org http://lists.linuxcontainers.org/listinfo/lxc-devel