@@ -275,6 +275,10 @@ Balloons policy parameters:
275275 should get their CPUs from separate cache blocks for best
276276 performance. Every listed class must be specified in
277277 `loadClasses`.
278+ - `schedulingClass` specifies the name of the scheduling class
279+ according to which containers in balloons are scheduled. Class
280+ properties are defined in separate `schedulingClasses` objects,
281+ see below.
278282 - `components` list includes component balloon types. If non-empty,
279283 the balloon is a composite balloon whose CPUs are not allocated
280284 directly to itself but its CPUs are the union of CPUs of its
@@ -318,6 +322,33 @@ Balloons policy parameters:
318322 physical `core` or different `l2cache` block. The default is
319323 `false`, that is, locality of balloon's CPUs is seen more
320324 important than avoiding balloon's own load.
325+ - `schedulingClasses`: is a list of scheduling related parameters
326+ organized in classes. These parameters tune containers when they are
327+ created but do not affect already running containers. The class of a
328+ container is defined with the `schedulingClass: <name>` option in
329+ container's balloon type, and can be overridden by
330+ `scheduling-class.resource-policy.nri.io` pod annotation. Each class
331+ in the list has following properties.
332+ - `name` is the name of the scheduling class.
333+ - `policy` is the Linux scheduling policy. Supported policies are:
334+ `none`, `other`, `fifo`, `rr`, `batch`, `idle`, and `deadline`.
335+ - `priority` is the scheduling priority. Refer to
336+ sched_setscheduler(2) documentation for valid values depending on
337+ the policy.
338+ - `flags` is a list of scheduling flags. Supported flags are:
339+ `reset-on-fork`, `reclaim`, `dl-overrun`, `keep-policy`,
340+ `keep-params`, `util-clamp-min`, `util-clamp-max`.
341+ - `nice`: nice value for the container process.
342+ - `runtime`: runtime value for `deadline` scheduling policy (in
343+ microseconds).
344+ - `deadline`: deadline value for `deadline` scheduling policy (in
345+ microseconds).
346+ - `period`: period value for `deadline` scheduling policy (in
347+ microseconds).
348+ - `ioClass`: IO class for the container process. Supported classes
349+ are: `none`, `rt` for realtime, `be` for best-effort, and `idle`.
350+ - `ioPriority`: IO priority for the container process. Refer
351+ to ionice(1) documentation for valid values.
321352- `control.cpu.classes`: defines CPU classes and their
322353 properties. Class names are keys followed by properties:
323354 - `disabledCstates` is a list of c-state names that are disabled
@@ -389,12 +420,19 @@ spec:
389420 allocatorTopologyBalancing: true
390421 idleCPUClass: lowpower
391422 balloonTypes:
392- - name: "quad"
393- maxCPUs: 4
394- cpuClass: dynamic
395- namespaces:
396- - "*"
397- showContainersInNrt: true
423+ - name: "quad"
424+ maxCPUs: 4
425+ cpuClass: dynamic
426+ namespaces:
427+ - "*"
428+ showContainersInNrt: true
429+ schedulingClasses:
430+ - name: run-when-idle
431+ policy: idle
432+ ioClass: idle
433+ - name: high-priority
434+ nice: -10
435+ ioClass: rt
398436 control:
399437 cpu:
400438 classes:
@@ -415,6 +453,14 @@ spec:
415453 prometheusExport: true
416454```
417455
456+ Because all namespaces are assigned to the "quad" balloon type, all
457+ containers (except for ` kube-system ` ) will be assigned to balloons of
458+ this type unless overridden by pod annotation. The configuration
459+ specifies ` run-when-idle ` and ` high-priority ` classes in
460+ ` schedulingClasses ` to allow higher priority containers to be
461+ prioritized over lower priority containers should they share the same
462+ CPUs, and even if they request equally many CPUs.
463+
418464## Assigning a Container to a Balloon
419465
420466The balloon type of a container can be defined in pod annotations. In
0 commit comments