[PATCH v2] docs: sched_ext: Document the isolcpus= domain isolation restriction
From: Shaojie Sun
Date: Thu Dec 03 2026 - 04:51:16 EST
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@xxxxxxxxxx>
---
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