Commit 54253380 authored by Tycho Andersen's avatar Tycho Andersen Committed by Pavel Emelyanov

cgroup: treat memory.oom_control specially too

Similar to f444f7fac40, we need to treat memory.oom_control as a "special"
property and try not to write its default value, since in the 3.11 kernel
it can't be written when memory.use_heirarchy is true, which is the
default.

CC: Andrei Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 379215e1
...@@ -949,6 +949,7 @@ static const char *special_props[] = { ...@@ -949,6 +949,7 @@ static const char *special_props[] = {
"cpuset.mems", "cpuset.mems",
"memory.kmem.limit_in_bytes", "memory.kmem.limit_in_bytes",
"memory.swappiness", "memory.swappiness",
"memory.oom_control",
"memory.use_hierarchy", "memory.use_hierarchy",
NULL, NULL,
}; };
...@@ -1425,12 +1426,16 @@ static int restore_special_props(char *paux, size_t off, CgroupDirEntry *e) ...@@ -1425,12 +1426,16 @@ static int restore_special_props(char *paux, size_t off, CgroupDirEntry *e)
if (strcmp(name, prop->name) == 0) { if (strcmp(name, prop->name) == 0) {
/* XXX: we can drop this hack and make /* XXX: we can drop this hack and make
* memory.swappiness a regular property when we * memory.swappiness and memory.oom_control
* drop support for kernels < 3.16. See 3dae7fec5. * regular properties when we drop support for
* kernels < 3.16. See 3dae7fec5.
*/ */
if (!strcmp(prop->name, "memory.swappiness") && if (!strcmp(prop->name, "memory.swappiness") &&
!strcmp(prop->value, "60")) { !strcmp(prop->value, "60")) {
continue; continue;
} else if (!strcmp(prop->name, "memory.oom_control") &&
!strcmp(prop->value, "0")) {
continue;
} else if (restore_cgroup_prop(prop, paux, off) < 0) { } else if (restore_cgroup_prop(prop, paux, off) < 0) {
return -1; return -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment