Skip to contentSkip to conversation

docs/sched_ext: document that cgroup CPU knobs are scheduler-dependent

PATCH Applied Tao Cui 3 participants 3 messages Aug 24

Subsystems (3)
lore
Share & tools
lore

Tao Cui

author
#0 lore raw

PATCH v4 1/1 docs/sched_ext: document that cgroup CPU knobs are scheduler-dependent

From: Tao Cui <[email protected]>

The scheduler core communicates the initial cpu controller settings to the BPF scheduler through ops.cgroup_init() and reports subsequent changes through the corresponding ops.cgroup_set_*() callbacks. Whether and how a knob takes effect is up to the loaded scheduler:
it may implement the corresponding callback partially or not at all, so cpu.max, cpu.weight and friends can silently have no effect.

Document this in the basics section of sched-ext.rst.

---
v3 -> v4: Rephrase per Andrea's suggestion: mention ops.cgroup_init() for the initial values, ops.cgroup_set_*() only for subsequent changes, and disambiguate per-task nice (ops.set_weight()) from cpu.weight.nice.

v3: https://lore.kernel.org/r/[email protected]

 Documentation/scheduler/sched-ext.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/scheduler/sched-ext.rst +15 -0
index 35b550671ca7..794ae80b3ba3 100644
@@ -242,6 +242,21 @@ optional. The following modified excerpt is from
             .name                   = "simple",
     };
 
+Scheduler-Dependent Knobs
+-------------------------
+
+The fair-class scheduler enforces CPU controller settings such as
+``cpu.max``, ``cpu.weight`` and ``cpu.idle``. For sched_ext tasks, the
+scheduler core communicates these settings to the BPF scheduler
+through ``ops.cgroup_init()`` and reports subsequent changes through
+the corresponding ``ops.cgroup_set_*()`` callbacks. Similarly, per-task
+nice changes are converted to weights and reported through
+``ops.set_weight()``.
+
+Each BPF scheduler is responsible for implementing the scheduling
+semantics of these settings and may choose to ignore them. Consult the
+loaded scheduler's documentation before relying on these controls.
+
 Dispatch Queues
 ---------------
 
Signature · 1 line
2.43.0
reviewer Reviewed-by on v4 1/1
#1 lore raw
Quoted 9 lines · Tao Cui

From: Tao Cui <[email protected]>

The scheduler core communicates the initial cpu controller settings to the BPF scheduler through ops.cgroup_init() and reports subsequent changes through the corresponding ops.cgroup_set_*() callbacks. Whether and how a knob takes effect is up to the loaded scheduler:
it may implement the corresponding callback partially or not at all, so cpu.max, cpu.weight and friends can silently have no effect.

Quoted 3 lines

Document this in the basics section of sched-ext.rst.

Looks good to me now.

Thanks,
-Andrea

Quoted 40 lines

---
v3 -> v4: Rephrase per Andrea's suggestion: mention ops.cgroup_init() for the initial values, ops.cgroup_set_*() only for subsequent changes, and disambiguate per-task nice (ops.set_weight()) from cpu.weight.nice.

v3: https://lore.kernel.org/r/[email protected]

 Documentation/scheduler/sched-ext.rst | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
Documentation/scheduler/sched-ext.rst +15 -0
index 35b550671ca7..794ae80b3ba3 100644
@@ -242,6 +242,21 @@ optional. The following modified excerpt is from
             .name                   = "simple",
     };
 
+Scheduler-Dependent Knobs
+-------------------------
+
+The fair-class scheduler enforces CPU controller settings such as
+``cpu.max``, ``cpu.weight`` and ``cpu.idle``. For sched_ext tasks, the
+scheduler core communicates these settings to the BPF scheduler
+through ``ops.cgroup_init()`` and reports subsequent changes through
+the corresponding ``ops.cgroup_set_*()`` callbacks. Similarly, per-task
+nice changes are converted to weights and reported through
+``ops.set_weight()``.
+
+Each BPF scheduler is responsible for implementing the scheduling
+semantics of these settings and may choose to ignore them. Consult the
+loaded scheduler's documentation before relying on these controls.
+
 Dispatch Queues
 ---------------
 
Signature · 1 line
2.43.0