* [PATCH sched_ext/for-6.11] sched_ext: Documentation: Remove mentions of scx_bpf_switch_all
@ 2024-07-01 12:30 Aboorva Devarajan
2024-07-01 17:53 ` Tejun Heo
0 siblings, 1 reply; 3+ messages in thread
From: Aboorva Devarajan @ 2024-07-01 12:30 UTC (permalink / raw)
To: tj, void; +Cc: aboorvad, linux-kernel
Updated sched_ext doc to eliminate references to scx_bpf_switch_all,
which has been removed in recent sched_ext versions.
Signed-off-by: Aboorva Devarajan <aboorvad@linux.ibm.com>
---
Documentation/scheduler/sched-ext.rst | 32 ++++++++++++++++-----------
1 file changed, 19 insertions(+), 13 deletions(-)
diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst
index 497eeaa5ecbe..d887e9e11256 100644
--- a/Documentation/scheduler/sched-ext.rst
+++ b/Documentation/scheduler/sched-ext.rst
@@ -44,17 +44,24 @@ options should be enabled to use sched_ext:
CONFIG_PAHOLE_HAS_SPLIT_BTF=y
CONFIG_PAHOLE_HAS_BTF_TAG=y
-sched_ext is used only when the BPF scheduler is loaded and running.
-If a task explicitly sets its scheduling policy to ``SCHED_EXT``, it will be
-treated as ``SCHED_NORMAL`` and scheduled by CFS until the BPF scheduler is
-loaded. On load, such tasks will be switched to and scheduled by sched_ext.
+sched_ext is used only when the BPF scheduler is loaded and running. To use
+sched_ext, a task can invoke ``sched_setscheduler`` with the ``SCHED_EXT``
+policy constant.
-The BPF scheduler can choose to schedule all normal and lower class tasks by
-calling ``scx_bpf_switch_all()`` from its ``init()`` operation. In this
-case, all ``SCHED_NORMAL``, ``SCHED_BATCH``, ``SCHED_IDLE`` and
-``SCHED_EXT`` tasks are scheduled by sched_ext. In the example schedulers,
-this mode can be selected with the ``-a`` option.
+When the BPF scheduler is not loaded, tasks with the ``SCHED_EXT`` policy are
+treated as ``SCHED_NORMAL`` and scheduled by CFS. ``SCHED_NORMAL`` tasks
+continue to be scheduled by CFS.
+
+When the BPF scheduler is loaded, all tasks with the ``SCHED_EXT`` policy are
+switched to sched_ext. By default, if the ``struct ops->flag`` is not set to
+``SCX_OPS_SWITCH_PARTIAL``, ``SCHED_EXT``, ``SCHED_NORMAL``, and lower class
+tasks are scheduled by sched_ext. In this case, all ``SCHED_NORMAL``,
+``SCHED_BATCH``, ``SCHED_IDLE``, and ``SCHED_EXT`` tasks are scheduled by
+sched_ext.
+
+However, if the ``struct ops->flag`` is set to``SCX_OPS_SWITCH_PARTIAL``,
+only tasks with the policy set to ``SCHED_EXT`` are scheduled by sched_ext.
Terminating the sched_ext scheduler program, triggering :kbd:`SysRq-S`, or
detection of any internal error including stalled runnable tasks aborts the
@@ -156,13 +163,12 @@ optional. The following modified excerpt is from
scx_bpf_dispatch(p, SCX_DSQ_GLOBAL, SCX_SLICE_DFL, enq_flags);
}
- s32 BPF_STRUCT_OPS(simple_init)
+ s32 BPF_STRUCT_OPS_SLEEPABLE(simple_init)
{
/*
- * All SCHED_OTHER, SCHED_IDLE, and SCHED_BATCH tasks should
- * use sched_ext.
+ * By default, all SCHED_EXT, SCHED_OTHER, SCHED_IDLE, and
+ * SCHED_BATCH tasks should use sched_ext.
*/
- scx_bpf_switch_all();
return 0;
}
--
2.25.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH sched_ext/for-6.11] sched_ext: Documentation: Remove mentions of scx_bpf_switch_all
2024-07-01 12:30 [PATCH sched_ext/for-6.11] sched_ext: Documentation: Remove mentions of scx_bpf_switch_all Aboorva Devarajan
@ 2024-07-01 17:53 ` Tejun Heo
2024-07-02 8:40 ` Aboorva Devarajan
0 siblings, 1 reply; 3+ messages in thread
From: Tejun Heo @ 2024-07-01 17:53 UTC (permalink / raw)
To: Aboorva Devarajan; +Cc: void, linux-kernel
Hello,
On Mon, Jul 01, 2024 at 06:00:22PM +0530, Aboorva Devarajan wrote:
...
> +sched_ext is used only when the BPF scheduler is loaded and running. To use
> +sched_ext, a task can invoke ``sched_setscheduler`` with the ``SCHED_EXT``
> +policy constant.
I wonder whether the last sentence is a bit confusing given that tasks can
be on SCX without setting SCHED_EXT.
> +When the BPF scheduler is not loaded, tasks with the ``SCHED_EXT`` policy are
> +treated as ``SCHED_NORMAL`` and scheduled by CFS. ``SCHED_NORMAL`` tasks
> +continue to be scheduled by CFS.
> +
> +When the BPF scheduler is loaded, all tasks with the ``SCHED_EXT`` policy are
> +switched to sched_ext. By default, if the ``struct ops->flag`` is not set to
> +``SCX_OPS_SWITCH_PARTIAL``, ``SCHED_EXT``, ``SCHED_NORMAL``, and lower class
> +tasks are scheduled by sched_ext. In this case, all ``SCHED_NORMAL``,
> +``SCHED_BATCH``, ``SCHED_IDLE``, and ``SCHED_EXT`` tasks are scheduled by
> +sched_ext.
How about something like:
When the BPF scheduler is loaded and ``SCX_OPS_SWITCH_PARTIAL`` is not set
in ops->flags, all ``SCHED_NORMAL``, ``SCHED_BATCH``, ``SCHED_IDLE``, and
``SCHED_EXT`` tasks are scheduled by sched_ext.
> +However, if the ``struct ops->flag`` is set to``SCX_OPS_SWITCH_PARTIAL``,
> +only tasks with the policy set to ``SCHED_EXT`` are scheduled by sched_ext.
And update this paragraph in a similar fashion?
Thanks.
--
tejun
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH sched_ext/for-6.11] sched_ext: Documentation: Remove mentions of scx_bpf_switch_all
2024-07-01 17:53 ` Tejun Heo
@ 2024-07-02 8:40 ` Aboorva Devarajan
0 siblings, 0 replies; 3+ messages in thread
From: Aboorva Devarajan @ 2024-07-02 8:40 UTC (permalink / raw)
To: Tejun Heo; +Cc: void, linux-kernel
On Mon, 2024-07-01 at 07:53 -1000, Tejun Heo wrote:
> Hello,
>
> On Mon, Jul 01, 2024 at 06:00:22PM +0530, Aboorva Devarajan wrote:
> ...
> > +sched_ext is used only when the BPF scheduler is loaded and
> > running. To use
> > +sched_ext, a task can invoke ``sched_setscheduler`` with the
> > ``SCHED_EXT``
> > +policy constant.
>
> I wonder whether the last sentence is a bit confusing given that
> tasks can
> be on SCX without setting SCHED_EXT.
>
> > +When the BPF scheduler is not loaded, tasks with the
> > ``SCHED_EXT`` policy are
> > +treated as ``SCHED_NORMAL`` and scheduled by CFS.
> > ``SCHED_NORMAL`` tasks
> > +continue to be scheduled by CFS.
> > +
> > +When the BPF scheduler is loaded, all tasks with the
> > ``SCHED_EXT`` policy are
> > +switched to sched_ext. By default, if the ``struct ops->flag`` is
> > not set to
> > +``SCX_OPS_SWITCH_PARTIAL``, ``SCHED_EXT``, ``SCHED_NORMAL``, and
> > lower class
> > +tasks are scheduled by sched_ext. In this case, all
> > ``SCHED_NORMAL``,
> > +``SCHED_BATCH``, ``SCHED_IDLE``, and ``SCHED_EXT`` tasks are
> > scheduled by
> > +sched_ext.
>
> How about something like:
>
> When the BPF scheduler is loaded and ``SCX_OPS_SWITCH_PARTIAL`` is
> not set
> in ops->flags, all ``SCHED_NORMAL``, ``SCHED_BATCH``,
> ``SCHED_IDLE``, and
> ``SCHED_EXT`` tasks are scheduled by sched_ext.
>
> > +However, if the ``struct ops->flag`` is set
> > to``SCX_OPS_SWITCH_PARTIAL``,
> > +only tasks with the policy set to ``SCHED_EXT`` are scheduled by
> > sched_ext.
>
> And update this paragraph in a similar fashion?
>
> Thanks.
>
Hi Tejun, Thanks for the review.
Sent out a v2 with the suggested changes.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-07-02 8:40 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-01 12:30 [PATCH sched_ext/for-6.11] sched_ext: Documentation: Remove mentions of scx_bpf_switch_all Aboorva Devarajan
2024-07-01 17:53 ` Tejun Heo
2024-07-02 8:40 ` Aboorva Devarajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®