cgroups: add support for oom control
This patch add support for diable OOM Killer. Signed-off-by: Hu Keping <hukeping@huawei.com>
This commit is contained in:
parent
334b196371
commit
295c70865d
|
@ -56,6 +56,12 @@ func (s *MemoryGroup) Set(path string, cgroup *configs.Cgroup) error {
|
|||
}
|
||||
}
|
||||
|
||||
if cgroup.OomKillDisable {
|
||||
if err := writeFile(path, "memory.oom_control", "1"); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
@ -51,4 +51,7 @@ type Cgroup struct {
|
|||
|
||||
// Parent slice to use for systemd TODO: remove in favor or parent
|
||||
Slice string `json:"slice"`
|
||||
|
||||
// Whether to disable OOM Killer
|
||||
OomKillDisable bool `json:"oom_kill_disable"`
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue