chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
cgroup: always enable memory.use_hierarchy= for all cgroups in the memory hierarchy
[elogind.git]
/
src
/
core
/
cgroup.c
diff --git
a/src/core/cgroup.c
b/src/core/cgroup.c
index d10f205a2ff431f807aa756fba53047c982fa11d..e66b8f4851f69691a8a23b9b8ebc7d4fe94ce7ba 100644
(file)
--- a/
src/core/cgroup.c
+++ b/
src/core/cgroup.c
@@
-254,8
+254,9
@@
void cgroup_context_apply(CGroupContext *c, CGroupControllerMask mask, const cha
}
if (mask & CGROUP_MEMORY) {
}
if (mask & CGROUP_MEMORY) {
- char buf[DECIMAL_STR_MAX(uint64_t) + 1];
if (c->memory_limit != (uint64_t) -1) {
if (c->memory_limit != (uint64_t) -1) {
+ char buf[DECIMAL_STR_MAX(uint64_t) + 1];
+
sprintf(buf, "%" PRIu64 "\n", c->memory_limit);
r = cg_set_attribute("memory", path, "memory.limit_in_bytes", buf);
} else
sprintf(buf, "%" PRIu64 "\n", c->memory_limit);
r = cg_set_attribute("memory", path, "memory.limit_in_bytes", buf);
} else
@@
-666,6
+667,9
@@
int manager_setup_cgroup(Manager *m) {
/* 6. Figure out which controllers are supported */
m->cgroup_supported = cg_mask_supported();
/* 6. Figure out which controllers are supported */
m->cgroup_supported = cg_mask_supported();
+ /* 7. Always enable hierarchial support if it exists... */
+ cg_set_attribute("memory", "/", "memory.use_hierarchy", "1");
+
return 0;
}
return 0;
}