Skip to content

Commit 7bb73da

Browse files
committed
runtime/v2/shim: remove unused SetScore() and remove sys.OOMScoreMaxKillable
The shim.SetScore() utility was no longer used since 7dfc605. Checking for uses outside of this repository, I found only one external use of this in gVisor; https://github.com/google/gvisor/blob/a9441aea2780da8c93da1c73da860219f98438de/pkg/shim/service.go#L262-L264 Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 91e7d21 commit 7bb73da

2 files changed

Lines changed: 0 additions & 7 deletions

File tree

runtime/v2/shim/util_unix.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,6 @@ func getSysProcAttr() *syscall.SysProcAttr {
4646
}
4747
}
4848

49-
// SetScore sets the oom score for a process
50-
func SetScore(pid int) error {
51-
return sys.SetOOMScore(pid, sys.OOMScoreMaxKillable)
52-
}
53-
5449
// AdjustOOMScore sets the OOM score for the process to the parents OOM score +1
5550
// to ensure that they parent has a lower* score than the shim
5651
// if not already at the maximum OOM Score

sys/oom_linux.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ import (
2828
)
2929

3030
const (
31-
// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
32-
OOMScoreMaxKillable = -999
3331
// OOMScoreAdjMin is from OOM_SCORE_ADJ_MIN https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L9
3432
OOMScoreAdjMin = -1000
3533
// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L10

0 commit comments

Comments
 (0)