Skip to content

Commit d931d4b

Browse files
committed
config-linux: add CFS bandwidth burst
Burstable CFS controller is introduced in Linux 5.14. This helps with parallel workloads that might be bursty. They can get throttled even when their average utilization is under quota. And they may be latency sensitive at the same time so that throttling them is undesired. This feature borrows time now against the future underrun, at the cost of increased interference against the other system users, by introducing `cfs_burst_us` into CFS bandwidth control to enact the cap on unused bandwidth accumulation, which will then used additionally for burst. The patch adds the support/control for CFS bandwidth burst. Fixes #1119 Signed-off-by: Kailun Qin <[email protected]>
1 parent 86290f6 commit d931d4b

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
@@ -360,6 +360,9 @@ The following parameters can be specified to set up the controller:
360360

361361
* **`shares`** *(uint64, OPTIONAL)* - specifies a relative share of CPU time available to the tasks in a cgroup
362362
* **`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)
363+
If specified with any (valid) positive value, it MUST be no smaller than `burst` (runtimes MAY generate an error).
364+
* **`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)
365+
If specified, this value MUST be no larger than any positive `quota` (runtimes MAY generate an error).
363366
* **`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)
364367
* **`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
365368
* **`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:
373376
"cpu": {
374377
"shares": 1024,
375378
"quota": 1000000,
379+
"burst": 1000000,
376380
"period": 500000,
377381
"realtimeRuntime": 950000,
378382
"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
@@ -275,6 +275,7 @@
275275
"cpu": {
276276
"shares": 1024,
277277
"quota": 1000000,
278+
"burst": 1000000,
278279
"period": 500000,
279280
"realtimeRuntime": 950000,
280281
"realtimePeriod": 1000000,

specs-go/config.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ type LinuxCPU struct {
327327
Shares *uint64 `json:"shares,omitempty"`
328328
// CPU hardcap limit (in usecs). Allowed cpu time in a given period.
329329
Quota *int64 `json:"quota,omitempty"`
330+
// CPU hardcap burst limit (in usecs). Allowed accumulated cpu time additionally for burst in a
331+
// given period.
332+
Burst *uint64 `json:"burst,omitempty"`
330333
// CPU period to be used for hardcapping (in usecs).
331334
Period *uint64 `json:"period,omitempty"`
332335
// How much time realtime scheduling may use (in usecs).

0 commit comments

Comments
 (0)