facebookincubator / oomd

A userspace out-of-memory killer
GNU General Public License v2.0
1.8k stars 143 forks source link

Crash oomd on startup if `--cgroup-fs` path is not cgroup2 #62

Open danobi opened 5 years ago

danobi commented 5 years ago

Letting oomd be silently run against a cgroup1 hierarchy could lead to subtle issues down the line.

danobi commented 5 years ago

Reported in #61

hakavlad commented 5 years ago

@danobi

You can find actual cgroup2 root location in /proc/mounts:

$ cat /proc/mounts | grep cgroup2
cgroup /sys/fs/cgroup/unified cgroup2 rw,nosuid,nodev,noexec,relatime,nsdelegate 0 0

Perhaps it is worth taking the default cgroup2 root from /proc/mounts instead of using /sys/fs/cgroup by default.

danobi commented 5 years ago

Perhaps it is worth taking the default cgroup2 root from /proc/mounts instead of using /sys/fs/cgroup by default.

Oh yeah I like this idea. I'll file a separate issue for this.