richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
c2dfb7
From 49c990010f48b429b52f73f54d70d529f0d2c7fe Mon Sep 17 00:00:00 2001
c2dfb7
From: Chris Down <chris@chrisdown.name>
c2dfb7
Date: Mon, 30 Sep 2019 18:24:26 +0100
c2dfb7
Subject: [PATCH] cgroup: Check ancestor memory min for unified memory config
c2dfb7
c2dfb7
Otherwise we might not enable it when we should, ie. DefaultMemoryMin is
c2dfb7
set in a parent, but not MemoryMin in the current unit.
c2dfb7
c2dfb7
(cherry picked from commit 7c9d2b79935d413389a603918a711df75acd3f48)
c2dfb7
c2dfb7
Related: #1763435
c2dfb7
---
c2dfb7
 src/core/cgroup.c | 2 +-
c2dfb7
 1 file changed, 1 insertion(+), 1 deletion(-)
c2dfb7
c2dfb7
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
c2dfb7
index d40f9cbc2a..4299923754 100644
c2dfb7
--- a/src/core/cgroup.c
c2dfb7
+++ b/src/core/cgroup.c
c2dfb7
@@ -851,7 +851,7 @@ static bool unit_has_unified_memory_config(Unit *u) {
c2dfb7
         c = unit_get_cgroup_context(u);
c2dfb7
         assert(c);
c2dfb7
 
c2dfb7
-        return c->memory_min > 0 || unit_get_ancestor_memory_low(u) > 0 ||
c2dfb7
+        return unit_get_ancestor_memory_min(u) > 0 || unit_get_ancestor_memory_low(u) > 0 ||
c2dfb7
                c->memory_high != CGROUP_LIMIT_MAX || c->memory_max != CGROUP_LIMIT_MAX ||
c2dfb7
                c->memory_swap_max != CGROUP_LIMIT_MAX;
c2dfb7
 }