runtime/v2/shim: remove unused SetScore() and remove sys.OOMScoreMaxKillable
The shim.SetScore() utility was no longer used since7dfc605fc6
. Checking for uses outside of this repository, I found only one external use of this in gVisor;a9441aea27/pkg/shim/service.go (L262-L264)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
91e7d21ee8
commit
7bb73da6b9
@ -46,11 +46,6 @@ func getSysProcAttr() *syscall.SysProcAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetScore sets the oom score for a process
|
|
||||||
func SetScore(pid int) error {
|
|
||||||
return sys.SetOOMScore(pid, sys.OOMScoreMaxKillable)
|
|
||||||
}
|
|
||||||
|
|
||||||
// AdjustOOMScore sets the OOM score for the process to the parents OOM score +1
|
// AdjustOOMScore sets the OOM score for the process to the parents OOM score +1
|
||||||
// to ensure that they parent has a lower* score than the shim
|
// to ensure that they parent has a lower* score than the shim
|
||||||
// if not already at the maximum OOM Score
|
// if not already at the maximum OOM Score
|
||||||
|
@ -28,8 +28,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// OOMScoreMaxKillable is the maximum score keeping the process killable by the oom killer
|
|
||||||
OOMScoreMaxKillable = -999
|
|
||||||
// OOMScoreAdjMin is from OOM_SCORE_ADJ_MIN https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L9
|
// OOMScoreAdjMin is from OOM_SCORE_ADJ_MIN https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L9
|
||||||
OOMScoreAdjMin = -1000
|
OOMScoreAdjMin = -1000
|
||||||
// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L10
|
// OOMScoreAdjMax is from OOM_SCORE_ADJ_MAX https://github.com/torvalds/linux/blob/v5.10/include/uapi/linux/oom.h#L10
|
||||||
|
Loading…
Reference in New Issue
Block a user