Skip to contentSkip to conversation

sched_ext: minor doc and comment fixes

PATCH In review Tao Cui 2 participants 4 messages Aug 13 – Aug 14

Subsystems (3)
lore
Share & tools
lore

Tao Cui

author
#0 lore raw

v2 cover sched_ext: minor doc and comment fixes

From: Tao Cui <[email protected]>

Two small doc and comment fixes noticed while
reading the code. No functional changes.

Changes in v2 (per Tejun's review):
- show_state example: aborting prints as False (drgn bools)
- inlines.h: use scx_bpf_sub_dispatch(), not scx_bpf_dsq_insert()
- internal.h: name %SCX_DEQ_SCHED_CHANGE instead of dropping the never-defined %SCX_DEQ_SAVE
- internal.h: reword @name to cover sub-schedulers
- rebase onto sched_ext/for-7.3

Tao Cui (2):
Documentation: sched_ext: fix events sysfs path and show_state example
sched_ext: fix stale references in doc comments

 Documentation/scheduler/sched-ext.rst | 9 +++++----
 kernel/sched/ext/inlines.h            | 2 +-
 kernel/sched/ext/internal.h           | 7 ++++---
 3 files changed, 10 insertions(+), 8 deletions(-)
Signature · 1 line
2.43.0
author
#1 lore raw

PATCH v2 1/2 Documentation: sched_ext: fix events sysfs path and show_state example

From: Tao Cui <[email protected]>

The events file is under the scheduler's sysfs kobject (/sys/kernel/sched_ext/root/events for the root scheduler), not the nonexistent "<scheduler-name>/events" path. Also add the missing "aborting" line to the scx_show_state.py example.

---
 Documentation/scheduler/sched-ext.rst | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
Documentation/scheduler/sched-ext.rst +5 -4
index ad2fff3..0e97fd0 100644
@@ -93,13 +93,13 @@ scheduler has been loaded):
     # cat /sys/kernel/sched_ext/enable_seq
     1
 
-Each running scheduler also exposes a per-scheduler ``events`` file under
-``/sys/kernel/sched_ext/<scheduler-name>/events`` that tracks diagnostic
-counters. Each counter occupies one ``name value`` line:
+Each running scheduler exposes an ``events`` file under its sysfs kobject
+(``/sys/kernel/sched_ext/root/events`` for the root scheduler) that tracks
+diagnostic counters. Each counter occupies one ``name value`` line:
 
 .. code-block:: none
 
-    # cat /sys/kernel/sched_ext/simple/events
+    # cat /sys/kernel/sched_ext/root/events
     SCX_EV_SELECT_CPU_FALLBACK 0
     SCX_EV_DISPATCH_LOCAL_DSQ_OFFLINE 0
     SCX_EV_DISPATCH_KEEP_LAST 123
@@ -153,6 +153,7 @@ detailed information:
     switching_all : 1
     switched_all  : 1
     enable_state  : enabled (2)
+    aborting      : False
     bypass_depth  : 0
     nr_rejected   : 0
     enable_seq    : 1
Signature · 1 line
2.43.0
author
#2 lore raw

PATCH v2 2/2 sched_ext: fix stale references in doc comments

In reply to Tao Cui

From: Tao Cui <[email protected]>

- inlines.h: scx_bpf_dispatch() doesn't exist; the comment means scx_bpf_sub_dispatch()
- internal.h: name %SCX_DEQ_SCHED_CHANGE instead of the never-defined %SCX_DEQ_SAVE
- internal.h: @name shows up in the ops file in the scheduler's sysfs directory, not a "kernel.sched_ext_ops" sysctl

---
 kernel/sched/ext/inlines.h  | 2 +-
 kernel/sched/ext/internal.h | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
kernel/sched/ext/inlines.h +1 -1
index 72d5ccd..8f3be59 100644
@@ -22,7 +22,7 @@ enum scx_dsp_verdict {
 };
 
 /*
- * One user of this function is scx_bpf_dispatch() which can be called
+ * One user of this function is scx_bpf_sub_dispatch() which can be called
  * recursively as sub-sched dispatches nest. Always inline to reduce stack usage
  * from the call frame.
  */
kernel/sched/ext/internal.h +4 -3
index b699e7c..c91296c 100644
@@ -485,7 +485,7 @@ struct sched_ext_ops {
 	 * - sleeping (%SCX_DEQ_SLEEP)
 	 * - being moved to another CPU
 	 * - being temporarily taken off the queue for an attribute change
-	 *   (%SCX_DEQ_SAVE)
+	 *   (%SCX_DEQ_SCHED_CHANGE)
 	 *
 	 * This and ->dequeue() are related but not coupled. This operation
 	 * notifies @p's state transition and may not be preceded by ->dequeue()
@@ -966,8 +966,9 @@ struct sched_ext_ops {
 	 * @name: BPF scheduler's name
 	 *
 	 * Must be a non-zero valid BPF object name including only isalnum(),
-	 * '_' and '.' chars. Shows up in kernel.sched_ext_ops sysctl while the
-	 * BPF scheduler is enabled.
+	 * '_' and '.' chars. Exposed via the ops file in the scheduler's sysfs
+	 * directory, /sys/kernel/sched_ext/root/ops for the root scheduler,
+	 * while the BPF scheduler is enabled.
 	 */
 	char name[SCX_OPS_NAME_LEN];
 
Signature · 1 line
2.43.0
reviewer
#3 lore raw
In reply to Tao Cui
Quoted 3 lines · Tao Cui

Tao Cui (2):
Documentation: sched_ext: fix events sysfs path and show_state example
sched_ext: fix stale references in doc comments

Applied 1-2 to sched_ext/for-7.3.

Thanks.

--
tejun