You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add bounds on max oom_score_adj value for AdjustOOMScore
oom_score_adj must be in the range -1000 to 1000. In AdjustOOMScore if containerd's score is already at the maximum value we should set that value for the shim instead of trying to set 1001 which is invalid.
Signed-off-by: Simon Kaegi <[email protected]>
Copy file name to clipboardExpand all lines: sys/oom_unix.go
+6-2Lines changed: 6 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -26,8 +26,12 @@ import (
26
26
"strings"
27
27
)
28
28
29
-
// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
30
-
constOOMScoreMaxKillable=-999
29
+
const (
30
+
// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
31
+
OOMScoreMaxKillable=-999
32
+
// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/master/include/uapi/linux/oom.h
33
+
OOMScoreAdjMax=1000
34
+
)
31
35
32
36
// SetOOMScore sets the oom score for the provided pid
0 commit comments