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

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