Skip to content

Commit 6188d9e

Browse files
authored
Merge pull request #1120 from kailun-qin/add-cfs-burst
config-linux: add CFS bandwidth burst
2 parents 494a5a6 + d931d4b commit 6188d9e

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

config-linux.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,9 @@ The following parameters can be specified to set up the controller:
365365

366366
* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup
367367
* **`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)
368+
If specified with any (valid) positive value, it MUST be no smaller than `burst` (runtimes MAY generate an error).
369+
* **`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)
370+
If specified, this value MUST be no larger than any positive `quota` (runtimes MAY generate an error).
368371
* **`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)
369372
* **`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
370373
* **`realtimePeriod`** *(uint64, OPTIONAL)* - same as **`period`** but applies to realtime scheduler only
@@ -378,6 +381,7 @@ The following parameters can be specified to set up the controller:
378381
"cpu": {
379382
"shares": 1024,
380383
"quota": 1000000,
384+
"burst": 1000000,
381385
"period": 500000,
382386
"realtimeRuntime": 950000,
383387
"realtimePeriod": 1000000,

schema/config-linux.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,9 @@
110110
"quota": {
111111
"$ref": "defs.json#/definitions/int64"
112112
},
113+
"burst": {
114+
"$ref": "defs.json#/definitions/uint64"
115+
},
113116
"realtimePeriod": {
114117
"$ref": "defs.json#/definitions/uint64"
115118
},

schema/test/config/good/spec-example.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@
276276
"cpu": {
277277
"shares": 1024,
278278
"quota": 1000000,
279+
"burst": 1000000,
279280
"period": 500000,
280281
"realtimeRuntime": 950000,
281282
"realtimePeriod": 1000000,

specs-go/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ type LinuxCPU struct {
331331
Shares *uint64 `json:"shares,omitempty"`
332332
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
333333
Quota *int64 `json:"quota,omitempty"`
334+
// CPU hardcap burst limit (in usecs). Allowed accumulated cpu time additionally for burst in a
335+
// given period.
336+
Burst *uint64 `json:"burst,omitempty"`
334337
// CPU period to be used for hardcapping (in usecs).
335338
Period *uint64 `json:"period,omitempty"`
336339
// How much time realtime scheduling may use (in usecs).

0 commit comments

Comments
 (0)