]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: Respect DefaultMemoryMin when setting memory.min
authorChris Down <chris@chrisdown.name>
Mon, 30 Sep 2019 17:25:09 +0000 (18:25 +0100)
committerChris Down <chris@chrisdown.name>
Mon, 30 Sep 2019 17:41:21 +0000 (18:41 +0100)
This is an oversight from https://github.com/systemd/systemd/pull/12332.

Sadly the tests didn't catch it since it requires a real cgroup
hierarchy to see, and it wasn't seen in prod since we're only currently
using DefaultMemoryLow, not DefaultMemoryMin. :-(

src/core/cgroup.c

index bcf06b0e6062e4a7edf16c56fa40ffe12fb24d17..74579a0a19eb059007e7ccbc4866750405e59d71 100644 (file)
@@ -1227,7 +1227,7 @@ static void cgroup_context_apply(
                                         log_cgroup_compat(u, "Applying MemoryLimit=%" PRIu64 " as MemoryMax=", max);
                         }
 
-                        cgroup_apply_unified_memory_limit(u, "memory.min", c->memory_min);
+                        cgroup_apply_unified_memory_limit(u, "memory.min", unit_get_ancestor_memory_min(u));
                         cgroup_apply_unified_memory_limit(u, "memory.low", unit_get_ancestor_memory_low(u));
                         cgroup_apply_unified_memory_limit(u, "memory.high", c->memory_high);
                         cgroup_apply_unified_memory_limit(u, "memory.max", max);