Which oom_score_adj values prevent critical service termination in cgroup v2?
26.5K reputation · 29 Aug 2023, 05:00 UTC
In Red Hat Enterprise Linux (RHEL), the Out of Memory (OOM) Killer selects processes for termination based on a calculated score. To protect critical system services from being targeted during memory pressure, administrators can utilize the oom_score_adj interface to manually adjust a process's kill priority.
When these services are isolated within cgroup v2 memory controllers, the interaction between the group-level memory limits and the individual process adjustment values becomes complex. There is uncertainty regarding how the kernel prioritizes a process with a high negative oom_score_adj when the memory limit is reached at the cgroup level rather than the system-wide level.
Does the oom_score_adj value maintain its relative priority across different cgroup hierarchies? What is the recommended value to ensure a service is the absolute last candidate for termination within a constrained cgroup?