summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Down <chris@chrisdown.name>2019-09-30 18:24:26 +0100
committerThe Plumber <50238977+systemd-rhel-bot@users.noreply.github.com>2020-06-08 22:00:46 +0200
commit49c990010f48b429b52f73f54d70d529f0d2c7fe (patch)
treeb2e33b6fd25d4301b968bd73d4015241e76996ad
parentef4157dab3d267c33ec2a06ae9bb5e4c87f785a6 (diff)
downloadsystemd-49c990010f48b429b52f73f54d70d529f0d2c7fe.tar.gz
cgroup: Check ancestor memory min for unified memory config
Otherwise we might not enable it when we should, ie. DefaultMemoryMin is set in a parent, but not MemoryMin in the current unit. (cherry picked from commit 7c9d2b79935d413389a603918a711df75acd3f48) Related: #1763435
-rw-r--r--src/core/cgroup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
index d40f9cbc2a..4299923754 100644
--- a/src/core/cgroup.c
+++ b/src/core/cgroup.c
@@ -851,7 +851,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;
}