]> git.ipfire.org Git - thirdparty/systemd.git/commit
oomd: Fix silent failure to find bad cgroups when another cgroup dies
authorChris Down <chris@chrisdown.name>
Tue, 17 Feb 2026 06:30:16 +0000 (14:30 +0800)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Feb 2026 08:32:26 +0000 (17:32 +0900)
commit4fb8cc53b3438eaafe27e22f168d3ae333ca037c
tree035f056de26bdc3a676a995b06eeafdd6333e0f0
parente757e791b26a998719f1347801853b88b41c9d74
oomd: Fix silent failure to find bad cgroups when another cgroup dies

Consider a workload slice with several sibling cgroups. Imagine that one
of those cgroups is removed between the moment oomd enumerates the
directory and the moment it reads memory.oom.group. This is actually
relatively plausible under the high memory pressure conditions where
oomd is most needed.

In this case, the failed read prompts us to `return 0`, which exits the
entire enumeration loop in recursively_get_cgroup_context(). As a
result, all remaining sibling cgroups are silently dropped from the
candidate list for that monitoring cycle.

The effect is that oomd can fail to identify and kill the actual
offending cgroup, allowing memory pressure to persist until a subsequent
cycle where the race doesn't occur.

Fix this by instead proceeding to evaluate further sibling cgroups.
src/oom/oomd-manager.c