daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
a4b143
From 91d2bf71864a1cb9f1228b65b126f5d74d8e09b9 Mon Sep 17 00:00:00 2001
a4b143
From: Lennart Poettering <lennart@poettering.net>
a4b143
Date: Mon, 23 Sep 2013 16:02:31 -0500
a4b143
Subject: [PATCH] cgroup: always enable memory.use_hierarchy= for all cgroups
a4b143
 in the memory hierarchy
a4b143
a4b143
The non-hierarchial mode contradicts the whole idea of a cgroup tree so
a4b143
let's not support this. In the future the kernel will only support the
a4b143
hierarchial logic anyway.
a4b143
---
a4b143
 src/core/cgroup.c | 3 ++-
a4b143
 1 file changed, 2 insertions(+), 1 deletion(-)
a4b143
a4b143
diff --git a/src/core/cgroup.c b/src/core/cgroup.c
a4b143
index 7f29afb..24a2306 100644
a4b143
--- a/src/core/cgroup.c
a4b143
+++ b/src/core/cgroup.c
a4b143
@@ -256,8 +256,9 @@ void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
a4b143
         }
a4b143
 
a4b143
         if (mask & CGROUP_MEMORY) {
a4b143
-                char buf[DECIMAL_STR_MAX(uint64_t) + 1];
a4b143
                 if (c->memory_limit != (uint64_t) -1) {
a4b143
+                        char buf[DECIMAL_STR_MAX(uint64_t) + 1];
a4b143
+
a4b143
                         sprintf(buf, "%" PRIu64 "\n", c->memory_limit);
a4b143
                         r = cg_set_attribute("memory", path, "memory.limit_in_bytes", buf);
a4b143
                 } else