Add oom-kill-disable support for systemd

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang
2015-07-08 09:21:46 +08:00
parent 5ec11a2918
commit b4d1df0131
@@ -505,6 +505,11 @@ func joinMemory(c *configs.Cgroup, pid int) error {
return err
}
}
if c.OomKillDisable {
if err := writeFile(path, "memory.oom_control", "1"); err != nil {
return err
}
}
if c.MemorySwappiness >= 0 && c.MemorySwappiness <= 100 {
err = writeFile(path, "memory.swappiness", strconv.FormatInt(c.MemorySwappiness, 10))