containerd / cgroups

cgroups package for Go

Home Page:https://containerd.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support OomGroupKill in cgroup2 memory events stats

sparrc opened this issue · comments

oom_group_kill cgroup events have been added to the linux kernel around a year ago: torvalds/linux@b6bf9ab

This is an event which tracks how many times the entire cgroup is "group" killed, in addition to the single process oom kills tracked by the existing oom_kill event. See https://docs.kernel.org/admin-guide/cgroup-v2.html#controllers for details about oom grouping:

memory.oom.group

    A read-write single value file which exists on non-root cgroups. The default value is "0".

    Determines whether the cgroup should be treated as an indivisible workload by the OOM killer. If set, all tasks belonging to the cgroup or to its descendants (if the memory cgroup is not a leaf cgroup) are killed together or not at all. This can be used to avoid partial kills to guarantee workload integrity.

...

I believe support for this event will need to be added to these three places (see existing oom_kill event for example):
https://github.com/containerd/cgroups/blob/main/cgroup2/stats/metrics.proto
https://github.com/containerd/cgroups/blob/main/cgroup2/stats/metrics.pb.txt
https://github.com/containerd/cgroups/blob/main/cgroup2/manager.go