ソースを参照

Merge pull request #41527 from thaJeztah/no_oom_score_adj

daemon: don't adjust oom-score if score is 0
Tibor Vass 4 年 前
コミット
cf867587b9
2 ファイル変更3 行追加3 行削除
  1. 3 0
      daemon/daemon_unix.go
  2. 0 3
      libcontainerd/supervisor/remote_daemon_linux.go

+ 3 - 0
daemon/daemon_unix.go

@@ -1636,6 +1636,9 @@ func setMayDetachMounts() error {
 }
 
 func setupOOMScoreAdj(score int) error {
+	if score == 0 {
+		return nil
+	}
 	f, err := os.OpenFile("/proc/self/oom_score_adj", os.O_WRONLY, 0)
 	if err != nil {
 		return err

+ 0 - 3
libcontainerd/supervisor/remote_daemon_linux.go

@@ -28,9 +28,6 @@ func (r *remote) setDefaults() {
 	if r.Debug.Address == "" {
 		r.Debug.Address = filepath.Join(r.stateDir, debugSockFile)
 	}
-	if r.OOMScore == 0 {
-		r.OOMScore = -999
-	}
 
 	for key, conf := range r.pluginConfs.Plugins {
 		if conf == nil {