Sched_ext development
 help / color / mirror / Atom feed
* [PATCH 0/2] sched_ext: documentation fixes
@ 2026-08-19  3:12 luoliang
  2026-08-19  3:12 ` [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle luoliang
  2026-08-19  3:12 ` [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example luoliang
  0 siblings, 2 replies; 7+ messages in thread
From: luoliang @ 2026-08-19  3:12 UTC (permalink / raw)
  To: Tejun Heo
  Cc: David Vernet, Andrea Righi, Changwoo Min, sched-ext, linux-kernel,
	Liang Luo

From: Liang Luo <luoliang@kylinos.cn>

Two documentation fixes found by cross-checking the documents against
the current kernel code:

  1. cgroup-v2.rst: cpu.max, cpu.max.burst and cpu.idle still claim to
     affect only the fair-class scheduler, but writes to these files
     also notify BPF schedulers through the cgroup_set_bandwidth and
     cgroup_set_idle callbacks. Mirror the existing cpu.weight wording.

  2. sched-ext.rst: the ops.exit() example reads ei->type, a field
     struct scx_exit_info has never had. Use ei->kind so the example
     compiles as written.

Liang Luo (2):
  Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for
    cpu.max and cpu.idle
  sched_ext: Fix nonexistent field in sched-ext.rst example

 Documentation/admin-guide/cgroup-v2.rst | 12 +++++++++---
 Documentation/scheduler/sched-ext.rst   |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

-- 
2.43.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle
  2026-08-19  3:12 [PATCH 0/2] sched_ext: documentation fixes luoliang
@ 2026-08-19  3:12 ` luoliang
  2026-08-19 20:08   ` Tejun Heo
  2026-08-20  2:37   ` [PATCH v2] " luoliang
  2026-08-19  3:12 ` [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example luoliang
  1 sibling, 2 replies; 7+ messages in thread
From: luoliang @ 2026-08-19  3:12 UTC (permalink / raw)
  To: Tejun Heo
  Cc: David Vernet, Andrea Righi, Changwoo Min, sched-ext, linux-kernel,
	Liang Luo

From: Liang Luo <luoliang@kylinos.cn>

The cpu.weight and cpu.weight.nice entries already state that the files
also affect a BPF scheduler through the cgroup_set_weight callback.
However, cpu.max, cpu.max.burst and cpu.idle only mention the fair-class
scheduler, even though sched_ext implements the cgroup_set_bandwidth
(notified with the period/quota from cpu.max and the burst from
cpu.max.burst) and cgroup_set_idle callbacks from these interfaces.

Mirror the cpu.weight wording for the three entries so BPF scheduler
users can discover these notification points.

Signed-off-by: Liang Luo <luoliang@kylinos.cn>
---
 Documentation/admin-guide/cgroup-v2.rst | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index aed195a71cbf..3f77f15d0543 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1202,7 +1202,9 @@ will be referred to. All time durations are in microseconds.
 	$PERIOD duration.  "max" for $MAX indicates no limit.  If only
 	one number is written, $MAX is updated.
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_bandwidth`` callback depending on what
+	the callback actually does.
 
   cpu.max.burst
 	A read-write single value file which exists on non-root
@@ -1210,7 +1212,9 @@ will be referred to. All time durations are in microseconds.
 
 	The burst in the range [0, $MAX].
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_bandwidth`` callback depending on what
+	the callback actually does.
 
   cpu.pressure
 	A read-write nested-keyed file.
@@ -1262,7 +1266,9 @@ will be referred to. All time durations are in microseconds.
 	own relative priorities, but the cgroup itself will be treated as
 	very low priority relative to its peers.
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_idle`` callback depending on what the
+	callback actually does.
 
 Memory
 ------
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example
  2026-08-19  3:12 [PATCH 0/2] sched_ext: documentation fixes luoliang
  2026-08-19  3:12 ` [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle luoliang
@ 2026-08-19  3:12 ` luoliang
  2026-08-19 20:08   ` Tejun Heo
  1 sibling, 1 reply; 7+ messages in thread
From: luoliang @ 2026-08-19  3:12 UTC (permalink / raw)
  To: Tejun Heo
  Cc: David Vernet, Andrea Righi, Changwoo Min, sched-ext, linux-kernel,
	Liang Luo

From: Liang Luo <luoliang@kylinos.cn>

The ops.exit() example in sched-ext.rst reads ei->type, but
struct scx_exit_info has never had a type field - the exit reason is
exposed as ei->kind since the struct was introduced. A scheduler
written following the example fails to compile with

    error: no member named 'type' in 'struct scx_exit_info'

Use ei->kind.

Fixes: fa48e8d2c7b5 ("sched_ext: Documentation: scheduler: Document extensible scheduler class")
Signed-off-by: Liang Luo <luoliang@kylinos.cn>
---
 Documentation/scheduler/sched-ext.rst | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst
index 2771ea4cc14a..96ff66c91ceb 100644
--- a/Documentation/scheduler/sched-ext.rst
+++ b/Documentation/scheduler/sched-ext.rst
@@ -229,7 +229,7 @@ optional. The following modified excerpt is from
 
     void BPF_STRUCT_OPS(simple_exit, struct scx_exit_info *ei)
     {
-            exit_type = ei->type;
+            exit_type = ei->kind;
     }
 
     SEC(".struct_ops")
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle
  2026-08-19  3:12 ` [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle luoliang
@ 2026-08-19 20:08   ` Tejun Heo
  2026-08-20  2:01     ` luoliang
  2026-08-20  2:37   ` [PATCH v2] " luoliang
  1 sibling, 1 reply; 7+ messages in thread
From: Tejun Heo @ 2026-08-19 20:08 UTC (permalink / raw)
  To: luoliang
  Cc: David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis,
	sched-ext, linux-kernel

Hello,

On Wed, Aug 19, 2026 at 11:12:43AM +0800, luoliang@kylinos.cn wrote:
> -	This file affects only processes under the fair-class scheduler.
> +	This file affects only processes under the fair-class scheduler and a BPF
> +	scheduler with the ``cgroup_set_bandwidth`` callback depending on what
> +	the callback actually does.

The "CPU Interface Files" preamble defines the categories that the
interface file entries refer back to and it only knows about
cgroup_set_weight:

  * Processes under the fair-class scheduler
  * Processes under a BPF scheduler with the ``cgroup_set_weight`` callback
  * Everything else: ``SCHED_{FIFO,RR,DEADLINE}`` and processes under a BPF
    scheduler without the ``cgroup_set_weight`` callback

With cpu.max, cpu.max.burst and cpu.idle now referring to
cgroup_set_bandwidth and cgroup_set_idle, the preamble no longer covers
the entries that follow it. Can you please update the preamble to match,
e.g. by making the bullets refer to the corresponding cgroup_set_*
callback, and resend?

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example
  2026-08-19  3:12 ` [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example luoliang
@ 2026-08-19 20:08   ` Tejun Heo
  0 siblings, 0 replies; 7+ messages in thread
From: Tejun Heo @ 2026-08-19 20:08 UTC (permalink / raw)
  To: luoliang
  Cc: David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis,
	sched-ext, linux-kernel

Applied to sched_ext/for-7.3-fixes.

Thanks.

--
tejun

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle
  2026-08-19 20:08   ` Tejun Heo
@ 2026-08-20  2:01     ` luoliang
  0 siblings, 0 replies; 7+ messages in thread
From: luoliang @ 2026-08-20  2:01 UTC (permalink / raw)
  To: Tejun Heo
  Cc: David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis,
	sched-ext, linux-kernel

Hello,

On Wed, Aug 19, 2026 at 10:08:32AM -1000, Tejun Heo wrote:
> The "CPU Interface Files" preamble defines the categories that the
> interface file entries refer back to and it only knows about
> cgroup_set_weight:
>
> With cpu.max, cpu.max.burst and cpu.idle now referring to
> cgroup_set_bandwidth and cgroup_set_idle, the preamble no longer covers
> the entries that follow it. Can you please update the preamble to match,
> e.g. by making the bullets refer to the corresponding cgroup_set_*
> callback, and resend?

Right, I missed that the preamble only knows cgroup_set_weight.
Generalized the bullets to the corresponding cgroup_set_* callback and
resent as v2.

Thanks for the review.

-- 
Liang

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle
  2026-08-19  3:12 ` [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle luoliang
  2026-08-19 20:08   ` Tejun Heo
@ 2026-08-20  2:37   ` luoliang
  1 sibling, 0 replies; 7+ messages in thread
From: luoliang @ 2026-08-20  2:37 UTC (permalink / raw)
  To: Tejun Heo
  Cc: David Vernet, Andrea Righi, Changwoo Min, Emil Tsalapatis,
	sched-ext, linux-kernel, Liang Luo

From: Liang Luo <luoliang@kylinos.cn>

The cpu.weight and cpu.weight.nice entries already state that the files
also affect a BPF scheduler through the cgroup_set_weight callback.
However, cpu.max, cpu.max.burst and cpu.idle only mention the fair-class
scheduler, even though sched_ext implements the cgroup_set_bandwidth
(notified with the period/quota from cpu.max and the burst from
cpu.max.burst) and cgroup_set_idle callbacks from these interfaces.

Mirror the cpu.weight wording for the three entries and generalize the
category preamble to refer to the corresponding cgroup_set_* callback so
it keeps covering the entries below.

Suggested-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Liang Luo <luoliang@kylinos.cn>

---
v2: Generalize the category preamble to the corresponding cgroup_set_*
callback so it keeps covering the entries below, per Tejun's review.

 Documentation/admin-guide/cgroup-v2.rst | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/Documentation/admin-guide/cgroup-v2.rst b/Documentation/admin-guide/cgroup-v2.rst
index aed195a71cbf..3dc6889ebdb2 100644
--- a/Documentation/admin-guide/cgroup-v2.rst
+++ b/Documentation/admin-guide/cgroup-v2.rst
@@ -1130,9 +1130,9 @@ policy and the underlying scheduler. From the point of view of the cpu controlle
 processes can be categorized as follows:
 
 * Processes under the fair-class scheduler
-* Processes under a BPF scheduler with the ``cgroup_set_weight`` callback
+* Processes under a BPF scheduler with the corresponding ``cgroup_set_*`` callback
 * Everything else: ``SCHED_{FIFO,RR,DEADLINE}`` and processes under a BPF scheduler
-  without the ``cgroup_set_weight`` callback
+  without the corresponding ``cgroup_set_*`` callback
 
 For details on when a process is under the fair-class scheduler or a BPF scheduler,
 check out :ref:`Documentation/scheduler/sched-ext.rst <sched-ext>`.
@@ -1202,7 +1202,9 @@ will be referred to. All time durations are in microseconds.
 	$PERIOD duration.  "max" for $MAX indicates no limit.  If only
 	one number is written, $MAX is updated.
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_bandwidth`` callback depending on what
+	the callback actually does.
 
   cpu.max.burst
 	A read-write single value file which exists on non-root
@@ -1210,7 +1212,9 @@ will be referred to. All time durations are in microseconds.
 
 	The burst in the range [0, $MAX].
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_bandwidth`` callback depending on what
+	the callback actually does.
 
   cpu.pressure
 	A read-write nested-keyed file.
@@ -1262,7 +1266,9 @@ will be referred to. All time durations are in microseconds.
 	own relative priorities, but the cgroup itself will be treated as
 	very low priority relative to its peers.
 
-	This file affects only processes under the fair-class scheduler.
+	This file affects only processes under the fair-class scheduler and a BPF
+	scheduler with the ``cgroup_set_idle`` callback depending on what the
+	callback actually does.
 
 Memory
 ------
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-08-20  2:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-19  3:12 [PATCH 0/2] sched_ext: documentation fixes luoliang
2026-08-19  3:12 ` [PATCH 1/2] Docs/admin-guide/cgroup-v2: document BPF scheduler callbacks for cpu.max and cpu.idle luoliang
2026-08-19 20:08   ` Tejun Heo
2026-08-20  2:01     ` luoliang
2026-08-20  2:37   ` [PATCH v2] " luoliang
2026-08-19  3:12 ` [PATCH 2/2] sched_ext: Fix nonexistent field in sched-ext.rst example luoliang
2026-08-19 20:08   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox