diff --git a/config-linux.md b/config-linux.md index 178361f34..85479feee 100644 --- a/config-linux.md +++ b/config-linux.md @@ -360,6 +360,9 @@ The following parameters can be specified to set up the controller: * **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup * **`quota`** *(int64, OPTIONAL)* - specifies the total amount of time in microseconds for which all tasks in a cgroup can run during one period (as defined by **`period`** below) + If specified with any (valid) positive value, it MUST be no smaller than `burst` (runtimes MAY generate an error). +* **`burst`** *(uint64, OPTIONAL)* - specifies the maximum amount of accumulated time in microseconds for which all tasks in a cgroup can run additionally for burst during one period (as defined by **`period`** below) + If specified, this value MUST be no larger than any positive `quota` (runtimes MAY generate an error). * **`period`** *(uint64, OPTIONAL)* - specifies a period of time in microseconds for how regularly a cgroup's access to CPU resources should be reallocated (CFS scheduler only) * **`realtimeRuntime`** *(int64, OPTIONAL)* - specifies a period of time in microseconds for the longest continuous period in which the tasks in a cgroup have access to CPU resources * **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only @@ -373,6 +376,7 @@ The following parameters can be specified to set up the controller: "cpu": { "shares": 1024, "quota": 1000000, + "burst": 1000000, "period": 500000, "realtimeRuntime": 950000, "realtimePeriod": 1000000, diff --git a/schema/config-linux.json b/schema/config-linux.json index d551afb26..9bb534de0 100644 --- a/schema/config-linux.json +++ b/schema/config-linux.json @@ -110,6 +110,9 @@ "quota": { "$ref": "defs.json#/definitions/int64" }, + "burst": { + "$ref": "defs.json#/definitions/uint64" + }, "realtimePeriod": { "$ref": "defs.json#/definitions/uint64" }, diff --git a/schema/test/config/good/spec-example.json b/schema/test/config/good/spec-example.json index 83e91dcd2..67583f63c 100644 --- a/schema/test/config/good/spec-example.json +++ b/schema/test/config/good/spec-example.json @@ -275,6 +275,7 @@ "cpu": { "shares": 1024, "quota": 1000000, + "burst": 1000000, "period": 500000, "realtimeRuntime": 950000, "realtimePeriod": 1000000, diff --git a/specs-go/config.go b/specs-go/config.go index 7e9122103..fffd244d3 100644 --- a/specs-go/config.go +++ b/specs-go/config.go @@ -327,6 +327,9 @@ type LinuxCPU struct { Shares *uint64 `json:"shares,omitempty"` // CPU hardcap limit (in usecs). Allowed cpu time in a given period. Quota *int64 `json:"quota,omitempty"` + // CPU hardcap burst limit (in usecs). Allowed accumulated cpu time additionally for burst in a + // given period. + Burst *uint64 `json:"burst,omitempty"` // CPU period to be used for hardcapping (in usecs). Period *uint64 `json:"period,omitempty"` // How much time realtime scheduling may use (in usecs).