The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/7928

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) ===
This fixes swappiness on CgroupV1.
CGroupV2 support is still missing though.

Closes #7916

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 0e3c4e47b12e7b6f6be27dd7c0fd56c9a879a1f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Wed, 23 Sep 2020 23:07:33 -0400
Subject: [PATCH] lxd/cgroup: Fix memory.swappiness detection
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This fixes swappiness on CgroupV1.
CGroupV2 support is still missing though.

Closes #7916

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/cgroup/init.go | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lxd/cgroup/init.go b/lxd/cgroup/init.go
index 335d91e820..8fa085a06f 100644
--- a/lxd/cgroup/init.go
+++ b/lxd/cgroup/init.go
@@ -392,6 +392,10 @@ func init() {
                        cgControllers["memory.max_usage_in_bytes"] = V1
                }
 
+               if shared.PathExists("/sys/fs/cgroup/memory/memory.swappiness") 
{
+                       cgControllers["memory.swappiness"] = V1
+               }
+
                if 
shared.PathExists("/sys/fs/cgroup/memory/memory.memsw.limit_in_bytes") {
                        cgControllers["memory.memsw.limit_in_bytes"] = V1
                }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to