]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cgroup: Check ancestor memory min for unified memory config
authorChris Down <chris@chrisdown.name>
Mon, 30 Sep 2019 17:24:26 +0000 (18:24 +0100)
committerChris Down <chris@chrisdown.name>
Mon, 30 Sep 2019 17:24:26 +0000 (18:24 +0100)
Otherwise we might not enable it when we should, ie. DefaultMemoryMin is
set in a parent, but not MemoryMin in the current unit.

src/core/cgroup.c

index 423742969e59d94b72611dcdc5817b582f93c140..bcf06b0e6062e4a7edf16c56fa40ffe12fb24d17 100644 (file)
@@ -955,7 +955,7 @@ static bool unit_has_unified_memory_config(Unit *u) {
         c = unit_get_cgroup_context(u);
         assert(c);
 
-        return c->memory_min > 0 || unit_get_ancestor_memory_low(u) > 0 ||
+        return unit_get_ancestor_memory_min(u) > 0 || unit_get_ancestor_memory_low(u) > 0 ||
                c->memory_high != CGROUP_LIMIT_MAX || c->memory_max != CGROUP_LIMIT_MAX ||
                c->memory_swap_max != CGROUP_LIMIT_MAX;
 }