Sched_ext development
 help / color / mirror / Atom feed
* [PATCH] docs: sched_ext: Document the isolcpus= domain isolation restriction
@ 2026-12-03  8:03 Shaojie Sun
  2026-12-03  8:13 ` sashiko-bot
  2026-12-03  9:50 ` [PATCH v2] " Shaojie Sun
  0 siblings, 2 replies; 3+ messages in thread
From: Shaojie Sun @ 2026-12-03  8:03 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc
  Cc: linux-kernel, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Frederic Weisbecker, Waiman Long, Shuah Khan,
	Randy Dunlap, Shaojie Sun

sched_ext refuses to load when the machine was booted with isolcpus= using
the domain flag, which is the default when no flag is given. This has been
the behavior since commit 9f391f94a173 ("sched_ext: Disallow loading BPF
scheduler if isolcpus= domain isolation is in effect"), but none of the
documentation mentions it -- neither the sched_ext overview nor the CPU
isolation guide where isolcpus= is described. Attaching a BPF scheduler on
such a machine only fails with -EINVAL from the bpf link creation and a
single line in dmesg, so users have to reconstruct the reason from the
housekeeping, cpuset and sched_ext sources.

isolcpus= domain isolation only removes CPUs from the sched domains
without restricting affinity masks, which a BPF scheduler cannot honor.

Document the restriction and the supported alternative -- cpuset isolated
partitions -- in the sched_ext overview, and cross-reference it from the
scheduler domain isolation section of the CPU isolation guide, which is
where users configuring isolcpus= land.

Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
---
 Documentation/admin-guide/cpu-isolation.rst |  6 ++++++
 Documentation/scheduler/sched-ext.rst       | 19 +++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/Documentation/admin-guide/cpu-isolation.rst b/Documentation/admin-guide/cpu-isolation.rst
index 8c65d03fd28c..f18360f6f014 100644
--- a/Documentation/admin-guide/cpu-isolation.rst
+++ b/Documentation/admin-guide/cpu-isolation.rst
@@ -116,6 +116,12 @@ Interfaces
   less flexible alternative that doesn't allow for runtime
   reconfiguration.
 
+Note that boot-time domain isolation is not compatible with sched_ext: the
+BPF scheduler load fails with -EINVAL because the isolation is applied to
+the sched domains only, leaving the affected tasks with their full CPU
+affinity mask. Use cpuset isolated partitions if a sched_ext scheduler has
+to be loaded. See Documentation/scheduler/sched-ext.rst.
+
 IRQs isolation
 --------------
 
diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst
index 0e97fd019994..6814574efa90 100644
--- a/Documentation/scheduler/sched-ext.rst
+++ b/Documentation/scheduler/sched-ext.rst
@@ -60,6 +60,25 @@ by sched_ext, while tasks with ``SCHED_NORMAL``, ``SCHED_BATCH`` and
 ``SCHED_IDLE`` policies are scheduled by the fair-class scheduler which has
 higher sched_class precedence than ``SCHED_EXT``.
 
+Boot-time CPU isolation using ``isolcpus=`` with the ``domain`` flag, which
+is the default when no flag is given, is not supported: loading a BPF
+scheduler fails with ``-EINVAL``:
+
+.. code-block:: none
+
+    sched_ext: Not compatible with "isolcpus=" domain isolation
+
+``isolcpus=`` domain isolation removes the isolated CPUs from the top-level
+sched domains without restricting the affected tasks' CPU affinity masks.
+As sched_ext honors task affinity and nothing else constrains where those
+tasks may be placed, it cannot keep them on the isolated CPUs and would
+silently break the isolation, so the kernel refuses to load instead.
+
+Use cpuset isolated partitions (``cpuset.cpus.partition``) instead; they are
+reflected in each member task's CPU affinity mask and thus enforced by
+sched_ext. Boot-time domain isolation is reported in
+``/sys/devices/system/cpu/isolated``.
+
 Terminating the sched_ext scheduler program, triggering `SysRq-S`, or
 detection of any internal error including stalled runnable tasks aborts the
 BPF scheduler and reverts all tasks back to the fair-class scheduler.
-- 
2.50.1


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

* Re: [PATCH] docs: sched_ext: Document the isolcpus= domain isolation restriction
  2026-12-03  8:03 [PATCH] docs: sched_ext: Document the isolcpus= domain isolation restriction Shaojie Sun
@ 2026-12-03  8:13 ` sashiko-bot
  2026-12-03  9:50 ` [PATCH v2] " Shaojie Sun
  1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-03  8:13 UTC (permalink / raw)
  To: Shaojie Sun; +Cc: sched-ext

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] docs: sched_ext: inaccurate isolcpus= domain isolation affinity
  description
--

commit 77f7da4a51719b1dc3cba589f535023492b079e1
Author: Shaojie Sun <sunshaojie@kylinos.cn>

docs: sched_ext: Document the isolcpus= domain isolation restriction

This commit documents that sched_ext refuses to load when boot-time
isolcpus= domain isolation is active and recommends cpuset isolated
partitions instead.

> diff --git a/Documentation/admin-guide/cpu-isolation.rst b/Documentation/admin-guide/cpu-isolation.rst
> index b9f13a9286734..64a0570135e98 100644
> --- a/Documentation/admin-guide/cpu-isolation.rst
> +++ b/Documentation/admin-guide/cpu-isolation.rst
> @@ -116,6 +116,12 @@ Interfaces
>    less flexible alternative that doesn't allow for runtime
>    reconfiguration.
>  
> +Note that boot-time domain isolation is not compatible with sched_ext: the
> +BPF scheduler load fails with -EINVAL because the isolation is applied to
> +the sched domains only, leaving the affected tasks with their full CPU
> +affinity mask. Use cpuset isolated partitions if a sched_ext scheduler has
> +to be loaded. See Documentation/scheduler/sched-ext.rst.
> +
>  IRQs isolation
>  --------------
>  

[Severity: Low]
Is it accurate to say boot-time domain isolation applies to sched domains
only and leaves affected tasks with their full CPU affinity mask?

sched_init_smp() restricts init and its descendant userspace tasks to
housekeeping_cpumask(HK_TYPE_DOMAIN).  kthread_fetch_affinity() and
workqueue_init_early() do the same for unbound kthreads and workqueues,
which the Scheduler domain isolation section of this file already notes.

As explained in 9f391f94a173 ("sched_ext: Disallow loading BPF scheduler if
isolcpus= domain isolation is in effect"), the incompatibility is that
isolcpus= does not enforce partition boundaries on task cpumasks, so a task
on an isolated CPU may still have other CPUs in its allowed mask.

Documentation/scheduler/sched-ext.rst and the commit message make the same
claim about task CPU affinity masks not being restricted, and could be
updated to describe the missing partition enforcement on task cpumasks
instead.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261203080337.732449-1-sunshaojie@kylinos.cn?part=1

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

* [PATCH v2] docs: sched_ext: Document the isolcpus= domain isolation restriction
  2026-12-03  8:03 [PATCH] docs: sched_ext: Document the isolcpus= domain isolation restriction Shaojie Sun
  2026-12-03  8:13 ` sashiko-bot
@ 2026-12-03  9:50 ` Shaojie Sun
  1 sibling, 0 replies; 3+ messages in thread
From: Shaojie Sun @ 2026-12-03  9:50 UTC (permalink / raw)
  To: Jonathan Corbet, linux-doc
  Cc: linux-kernel, sched-ext, Tejun Heo, David Vernet, Andrea Righi,
	Changwoo Min, Frederic Weisbecker, Waiman Long, Shuah Khan,
	Randy Dunlap, Shaojie Sun

sched_ext refuses to load when the machine was booted with isolcpus= using
the domain flag, which is the default when no flag is given. This has been
the behavior since commit 9f391f94a173 ("sched_ext: Disallow loading BPF
scheduler if isolcpus= domain isolation is in effect"), but neither the
sched_ext overview nor the CPU isolation guide where isolcpus= is
described mentions it. Attaching a BPF scheduler on such a machine only
fails with -EINVAL from the BPF link creation and a single line in dmesg,
so users have to reconstruct the reason from the housekeeping and
sched_ext sources.

Document this in the sched_ext overview for users configuring CPU
isolation from the command line, and cross-reference it from the scheduler
domain isolation section of the CPU isolation guide.

Signed-off-by: Shaojie Sun <sunshaojie@kylinos.cn>
---
v2: Fixed the inaccurate task affinity mask description pointed out by
    Sashiko: the masks are not left unrestricted, they are just not
    confined to a partition the way cpuset isolated partitions are.

 Documentation/admin-guide/cpu-isolation.rst |  5 +++++
 Documentation/scheduler/sched-ext.rst       | 18 ++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/Documentation/admin-guide/cpu-isolation.rst b/Documentation/admin-guide/cpu-isolation.rst
index 8c65d03fd28c..cf7751bc1ae2 100644
--- a/Documentation/admin-guide/cpu-isolation.rst
+++ b/Documentation/admin-guide/cpu-isolation.rst
@@ -116,6 +116,11 @@ Interfaces
   less flexible alternative that doesn't allow for runtime
   reconfiguration.
 
+Note that boot-time domain isolation is not compatible with sched_ext:
+loading a BPF scheduler fails with -EINVAL because the isolation is not
+enforced on task CPU affinity masks. See
+Documentation/scheduler/sched-ext.rst.
+
 IRQs isolation
 --------------
 
diff --git a/Documentation/scheduler/sched-ext.rst b/Documentation/scheduler/sched-ext.rst
index 0e97fd019994..89a8a6953414 100644
--- a/Documentation/scheduler/sched-ext.rst
+++ b/Documentation/scheduler/sched-ext.rst
@@ -60,6 +60,24 @@ by sched_ext, while tasks with ``SCHED_NORMAL``, ``SCHED_BATCH`` and
 ``SCHED_IDLE`` policies are scheduled by the fair-class scheduler which has
 higher sched_class precedence than ``SCHED_EXT``.
 
+Boot-time CPU isolation using ``isolcpus=`` with the ``domain`` flag, which
+is the default when no flag is given, is not supported: loading a BPF
+scheduler fails with ``-EINVAL``:
+
+.. code-block:: none
+
+    sched_ext: Not compatible with "isolcpus=" domain isolation
+
+``isolcpus=`` domain isolation removes the isolated CPUs from the top-level
+sched domains, but unlike cpuset isolated partitions it puts no further
+restriction on task CPU affinity masks: a task can be affined to both
+isolated and housekeeping CPUs. sched_ext has no notion of such a
+partition, so it may place that task on any CPU in its mask and would
+silently break the isolation; the kernel therefore refuses to load. Use
+cpuset isolated partitions (``cpuset.cpus.partition``) if CPU isolation is
+needed. Boot-time domain isolation is reported in
+``/sys/devices/system/cpu/isolated``.
+
 Terminating the sched_ext scheduler program, triggering `SysRq-S`, or
 detection of any internal error including stalled runnable tasks aborts the
 BPF scheduler and reverts all tasks back to the fair-class scheduler.
-- 
2.50.1


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

end of thread, other threads:[~2026-12-03  9:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03  8:03 [PATCH] docs: sched_ext: Document the isolcpus= domain isolation restriction Shaojie Sun
2026-12-03  8:13 ` sashiko-bot
2026-12-03  9:50 ` [PATCH v2] " Shaojie Sun

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