kernel_explainer/oom.rs
1// OOM score → description (low/moderate/high/critical).
2//
3// See plan.md §2f for the bands.
4
5pub fn oom_description(score: i32) -> &'static str {
6 match score {
7 s if s < 0 => "Adjusted below 0 — unlikely to be killed",
8 0..=100 => "Low kill likelihood — kernel prefers to keep this process",
9 101..=500 => "Moderate kill likelihood — may be killed under memory pressure",
10 501..=900 => "High kill likelihood — one of the first OOM kill candidates",
11 _ => "Critical — killed first under any memory pressure",
12 }
13}