From 6b1da04a97ded39e19b1abf691d451ea65b1fd80 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 78a27eaa079..6ded4c8e97e 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.