From 5ec1caea681e1f070c555053c5bfca3340b4d5e7 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 3 Nov 2020 19:36:41 -0800 Subject: [PATCH] libct/cg/sd/v2: "support" (ignore") memory.oom.group Signed-off-by: Kir Kolyshkin --- libcontainer/cgroups/systemd/v2.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libcontainer/cgroups/systemd/v2.go b/libcontainer/cgroups/systemd/v2.go index 177f8e44a21..23e1646ee2c 100644 --- a/libcontainer/cgroups/systemd/v2.go +++ b/libcontainer/cgroups/systemd/v2.go @@ -128,6 +128,15 @@ func unifiedResToSystemdProps(conn *systemdDbus.Conn, res map[string]string) (pr newProp("TasksAccounting", true), newProp("TasksMax", num)) + case "memory.oom.group": + // Setting this to 1 is roughly equivalent to OOMPolicy=kill + // (as per systemd.service(5) and + // https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v2.html), + // but it's not clear what to do if it is unset or set + // to 0 in runc update, as there are two other possible + // values for OOMPolicy (continue/stop). + fallthrough + default: // Ignore the unknown resource here -- will still be // applied in Set which calls fs2.Set.