All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 sched_ext/for-7.3] sched_ext: Bandwidth-limited rescue execution for stranded tasks
@ 2026-08-02 21:54 Tejun Heo
  2026-08-02 21:54 ` [PATCH 01/12] sched_ext: Rename scx_local_or_reject_dsq() to scx_resolve_local_dsq() Tejun Heo
                   ` (13 more replies)
  0 siblings, 14 replies; 18+ messages in thread
From: Tejun Heo @ 2026-08-02 21:54 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel

Hello,

v2: Changes from the sashiko AI review:

    - Declare scx_sched_all outside the CONFIG_EXT_SUB_SCHED block, the
      definition is unconditional (0002).

    - Track the overload grace and usage-decay timestamps in jiffies_64 so
      that 32-bit arithmetic on them can't wrap (0009).

    - Drop the now-unread always_enq_immed rodata mirror (0011).

v1: https://lore.kernel.org/r/20260801085150.2697653-1-tj@kernel.org

A sub-scheduler holds only the cids its parent granted and nothing
guarantees that they cover its tasks' affinities. A task that can run on
none of them currently has no good ending: the scheduler's insert is
cap-rejected and reenqueued until the repeat limit ejects the scheduler, or
the task stalls into the watchdog.

This series adds kernel-side rescue execution. A scheduler marks an insert
that may be cap-rejected with SCX_ENQ_RESCUE and the kernel, instead of
bouncing it, runs the task on the target cpu at a small configured
bandwidth. A rescue starts out non-disruptive. Schedulers that hold caps on
the cid largely stay in control of the cpu - a preemption cap, for example,
still lets its holder preempt the rescuee. When a rescue goes unserved for
too long, it escalates into protected execution.

When a cpu's rescue queue stays oversaturated past the overload threshold,
the kernel ejects the sub-scheduler with the highest recent rescue
consumption on that cpu instead of misblaming the waiter's owner.

- 0001-0005 are preps: naming, helper visibility, dsq-move flag vetting and
  the IGNORE_CAPS preemption waiver.
- 0006-0007 synchronize slice/dsq_vtime writes at insertion commit and add
  SCX_TASK_PROTECTED, the groundwork that lets a kernel-granted slice
  survive scheduler writes.
- 0008-0009 add the rescue machinery and the overload ejection.
- 0010 syncs the tools autogen enum headers.
- 0011-0012 fix scx_qmap's pinned-task direct dispatch and add rescue
  support as the demonstration consumer.

 0001-sched_ext-Rename-scx_local_or_reject_dsq-to-scx_reso.patch
 0002-sched_ext-Make-several-ext.c-helpers-available-outsi.patch
 0003-sched_ext-Factor-out-__scx_bpf_now.patch
 0004-sched_ext-Reject-internal-enq_flags-in-the-dsq-move-.patch
 0005-sched_ext-Make-SCX_ENQ_IGNORE_CAPS-waive-the-preempt.patch
 0006-sched_ext-Synchronize-slice-and-dsq_vtime-writes.patch
 0007-sched_ext-Add-SCX_TASK_PROTECTED.patch
 0008-sched_ext-Add-bandwidth-limited-rescue-execution-for.patch
 0009-sched_ext-Eject-the-top-rescue-consumer-on-overload.patch
 0010-sched_ext-Sync-tools-autogen-enum-headers.patch
 0011-sched_ext-scx_qmap-Idle-check-pinned-tasks-before-di.patch
 0012-sched_ext-scx_qmap-Add-rescue-support.patch

Based on sched_ext/for-7.3 (c5b9316cf3d5).

Git tree: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-rescue-v2

 include/linux/sched/ext.h                       |   7 +
 kernel/sched/ext/ext.c                          | 690 ++++++++++++++++--------
 kernel/sched/ext/internal.h                     |  78 ++-
 kernel/sched/ext/sub.c                          | 497 ++++++++++++++++-
 kernel/sched/ext/sub.h                          |  41 +-
 kernel/sched/ext/types.h                        |  12 +
 kernel/sched/sched.h                            |  13 +
 tools/sched_ext/include/scx/enum_defs.autogen.h |  16 +
 tools/sched_ext/include/scx/enums.autogen.bpf.h |   3 +
 tools/sched_ext/include/scx/enums.autogen.h     |   1 +
 tools/sched_ext/scx_qmap.bpf.c                  |  89 +--
 tools/sched_ext/scx_qmap.c                      |  24 +-
 tools/sched_ext/scx_qmap.h                      |   1 +
 13 files changed, 1187 insertions(+), 285 deletions(-)

--
tejun

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCHSET sched_ext/for-7.3] sched_ext: Bandwidth-limited rescue execution for stranded tasks
@ 2026-08-01  8:51 Tejun Heo
  2026-08-01  8:51 ` [PATCH 10/12] sched_ext: Sync tools autogen enum headers Tejun Heo
  0 siblings, 1 reply; 18+ messages in thread
From: Tejun Heo @ 2026-08-01  8:51 UTC (permalink / raw)
  To: David Vernet, Andrea Righi, Changwoo Min
  Cc: sched-ext, Emil Tsalapatis, linux-kernel

Hello,

A sub-scheduler holds only the cids its parent granted and nothing
guarantees that they cover its tasks' affinities. A task that can run on
none of them currently has no good ending: the scheduler's insert is
cap-rejected and reenqueued until the repeat limit ejects the scheduler, or
the task stalls into the watchdog.

This series adds kernel-side rescue execution. A scheduler marks an insert
that may be cap-rejected with SCX_ENQ_RESCUE and the kernel, instead of
bouncing it, runs the task on the target cpu at a small configured
bandwidth. A rescue starts out non-disruptive. Schedulers that hold caps on
the cid largely stay in control of the cpu - a preemption cap, for example,
still lets its holder preempt the rescuee. When a rescue goes unserved for
too long, it escalates into protected execution.

When a cpu's rescue queue stays oversaturated past the overload threshold,
the kernel ejects the sub-scheduler with the highest recent rescue
consumption on that cpu instead of misblaming the waiter's owner.

- 0001-0005 are preps: naming, helper visibility, dsq-move flag vetting and
  the IGNORE_CAPS preemption waiver.
- 0006-0007 synchronize slice/dsq_vtime writes at insertion commit and add
  SCX_TASK_PROTECTED, the groundwork that lets a kernel-granted slice
  survive scheduler writes.
- 0008-0009 add the rescue machinery and the overload ejection.
- 0010 syncs the tools autogen enum headers.
- 0011-0012 fix scx_qmap's pinned-task direct dispatch and add rescue
  support as the demonstration consumer.

 0001-sched_ext-Rename-scx_local_or_reject_dsq-to-scx_reso.patch
 0002-sched_ext-Make-several-ext.c-helpers-available-outsi.patch
 0003-sched_ext-Factor-out-__scx_bpf_now.patch
 0004-sched_ext-Reject-internal-enq_flags-in-the-dsq-move-.patch
 0005-sched_ext-Make-SCX_ENQ_IGNORE_CAPS-waive-the-preempt.patch
 0006-sched_ext-Synchronize-slice-and-dsq_vtime-writes.patch
 0007-sched_ext-Add-SCX_TASK_PROTECTED.patch
 0008-sched_ext-Add-bandwidth-limited-rescue-execution-for.patch
 0009-sched_ext-Eject-the-top-rescue-consumer-on-overload.patch
 0010-sched_ext-Sync-tools-autogen-enum-headers.patch
 0011-sched_ext-scx_qmap-Idle-check-pinned-tasks-before-di.patch
 0012-sched_ext-scx_qmap-Add-rescue-support.patch

Based on sched_ext/for-7.3 (ee7aece60817).

Git tree: git://git.kernel.org/pub/scm/linux/kernel/git/tj/sched_ext.git scx-rescue-v1

 include/linux/sched/ext.h                       |   7 +
 kernel/sched/ext/ext.c                          | 690 ++++++++++++++++--------
 kernel/sched/ext/internal.h                     |  78 ++-
 kernel/sched/ext/sub.c                          | 496 ++++++++++++++++-
 kernel/sched/ext/sub.h                          |  41 +-
 kernel/sched/ext/types.h                        |  12 +
 kernel/sched/sched.h                            |  13 +
 tools/sched_ext/include/scx/enum_defs.autogen.h |  16 +
 tools/sched_ext/include/scx/enums.autogen.bpf.h |   3 +
 tools/sched_ext/include/scx/enums.autogen.h     |   1 +
 tools/sched_ext/scx_qmap.bpf.c                  |  88 +--
 tools/sched_ext/scx_qmap.c                      |  23 +-
 tools/sched_ext/scx_qmap.h                      |   1 +
 13 files changed, 1186 insertions(+), 283 deletions(-)

--
tejun

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

end of thread, other threads:[~2026-08-03 21:37 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-02 21:54 [PATCHSET v2 sched_ext/for-7.3] sched_ext: Bandwidth-limited rescue execution for stranded tasks Tejun Heo
2026-08-02 21:54 ` [PATCH 01/12] sched_ext: Rename scx_local_or_reject_dsq() to scx_resolve_local_dsq() Tejun Heo
2026-08-02 21:54 ` [PATCH 02/12] sched_ext: Make several ext.c helpers available outside ext.c Tejun Heo
2026-08-02 21:54 ` [PATCH 03/12] sched_ext: Factor out __scx_bpf_now() Tejun Heo
2026-08-02 21:54 ` [PATCH 04/12] sched_ext: Reject internal enq_flags in the dsq move kfuncs Tejun Heo
2026-08-02 21:54 ` [PATCH 05/12] sched_ext: Make SCX_ENQ_IGNORE_CAPS waive the preemption cap too Tejun Heo
2026-08-02 21:54 ` [PATCH 06/12] sched_ext: Synchronize slice and dsq_vtime writes Tejun Heo
2026-08-02 21:54 ` [PATCH 07/12] sched_ext: Add SCX_TASK_PROTECTED Tejun Heo
2026-08-02 21:54 ` [PATCH 08/12] sched_ext: Add bandwidth-limited rescue execution for stranded tasks Tejun Heo
2026-08-03  8:10   ` Andrea Righi
2026-08-03 18:59   ` [PATCH v2 " Tejun Heo
2026-08-02 21:54 ` [PATCH 09/12] sched_ext: Eject the top rescue consumer on overload Tejun Heo
2026-08-02 21:54 ` [PATCH 10/12] sched_ext: Sync tools autogen enum headers Tejun Heo
2026-08-02 21:54 ` [PATCH 11/12] sched_ext: scx_qmap - Idle-check pinned tasks before direct dispatch Tejun Heo
2026-08-02 21:54 ` [PATCH 12/12] sched_ext: scx_qmap - Add rescue support Tejun Heo
2026-08-03 20:42 ` [PATCHSET v2 sched_ext/for-7.3] sched_ext: Bandwidth-limited rescue execution for stranded tasks Andrea Righi
2026-08-03 21:37 ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2026-08-01  8:51 [PATCHSET " Tejun Heo
2026-08-01  8:51 ` [PATCH 10/12] sched_ext: Sync tools autogen enum headers Tejun Heo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.