mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Merge pull request #39306 from hex108/oom_score_adj
Automatic merge from submit-queue (batch tested with PRs 38084, 39306) Small improve for GetContainerOOMScoreAdjust In `GetContainerOOMScoreAdjust`, make logic more clear for the case `oomScoreAdjust >= besteffortOOMScoreAdj`. If `besteffortOOMScoreAdj` is defined to another value(e.g. 996), suppose `oomScoreAdjust` is 999, the function will return 998(which equals 999 - 1) instead of 995(996 -1).
This commit is contained in:
commit
2cc9650e7e
@ -72,8 +72,8 @@ func GetContainerOOMScoreAdjust(pod *v1.Pod, container *v1.Container, memoryCapa
|
||||
return (1000 + guaranteedOOMScoreAdj)
|
||||
}
|
||||
// Give burstable pods a higher chance of survival over besteffort pods.
|
||||
if int(oomScoreAdjust) == besteffortOOMScoreAdj {
|
||||
return int(oomScoreAdjust - 1)
|
||||
if int(oomScoreAdjust) >= besteffortOOMScoreAdj {
|
||||
return int(besteffortOOMScoreAdj - 1)
|
||||
}
|
||||
return int(oomScoreAdjust)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user