From 9d363b36f6a7db184b0f7cc67b6f79204fb50107 Mon Sep 17 00:00:00 2001 From: wineway Date: Wed, 16 Feb 2022 16:06:20 +0800 Subject: [PATCH 1/2] config-linux: add idle option for container cgroup Signed-off-by: wineway --- config-linux.md | 4 +++- specs-go/config.go | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/config-linux.md b/config-linux.md index c8e02a293..f0efd041f 100644 --- a/config-linux.md +++ b/config-linux.md @@ -361,6 +361,7 @@ The following parameters can be specified to set up the controller: * **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only * **`cpus`** *(string, OPTIONAL)* - list of CPUs the container will run in * **`mems`** *(string, OPTIONAL)* - list of Memory Nodes the container will run in +* **`idle`** *(int64, OPTIONAL)* - cgroups are configured with minimum weight, 0: default behavior, 1: SCHED_IDLE. #### Example @@ -372,7 +373,8 @@ The following parameters can be specified to set up the controller: "realtimeRuntime": 950000, "realtimePeriod": 1000000, "cpus": "2-3", - "mems": "0-7" + "mems": "0-7", + "idle": 0 } ``` diff --git a/specs-go/config.go b/specs-go/config.go index c0e879448..83587f1dc 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -330,6 +330,8 @@ type LinuxCPU struct { Cpus string `json:"cpus,omitempty"` // List of memory nodes in the cpuset. Default is to use any available memory node. Mems string `json:"mems,omitempty"` + // cgroups are configured with minimum weight, 0: default behavior, 1: SCHED_IDLE. Default 0 + Idle *int64 `json:"idle,omitempty"` } // LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3) From b8dbce946e68f1f9ecbf04a9e728a0599fa872f9 Mon Sep 17 00:00:00 2001 From: wineway Date: Fri, 18 Feb 2022 11:25:52 +0800 Subject: [PATCH 2/2] update idle type of LinuxCPU from *int64 to int64 Signed-off-by: wineway --- specs-go/config.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specs-go/config.go b/specs-go/config.go index 83587f1dc..3803d1776 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -330,8 +330,8 @@ type LinuxCPU struct { Cpus string `json:"cpus,omitempty"` // List of memory nodes in the cpuset. Default is to use any available memory node. Mems string `json:"mems,omitempty"` - // cgroups are configured with minimum weight, 0: default behavior, 1: SCHED_IDLE. Default 0 - Idle *int64 `json:"idle,omitempty"` + // cgroups are configured with minimum weight, 0: default behavior, 1: SCHED_IDLE. + Idle int64 `json:"idle"` } // LinuxPids for Linux cgroup 'pids' resource management (Linux 4.3)