linux/include/linux/sched
Tejun Heo bb70e4fb62 sched_ext: Eject the top rescue consumer on overload
When rescue demand on a cpu persistently exceeds the configured bandwidth,
tasks age on that cpu's rescue DSQ until the stall watchdog fires. The
watchdog blames the waiting task's owner, but the misbehaving party is
whoever floods the queue, not whoever happens to time out.

Track each sched's recent rescue consumption per cpu as a decaying average.
Once the oldest waiter on a cpu's rescue DSQ has been queued past a
threshold derived from the rescue knobs (4s at the defaults), the rescue
timer ejects the sub with the highest recent consumption on that cpu with
SCX_EXIT_ERROR_RESCUE. With no recent consumer there is no victim and
nothing is ejected - the generic stall watchdog eventually blames the
waiter's owner instead. Ejections on a cpu are spaced one threshold apart so
the freed bandwidth can drain the backlog before another sub is judged.

The overload check only wins the race against the stall watchdog when the
watchdog timeout clears the threshold, and a single in-budget wait must not
cross the trigger on its own. Warn on a scheduler whose timeout doesn't fit
and on knobs whose funding period exceeds half the threshold.

v2: - Track kill_at in jiffies_64 - on 32-bit, the time_before() grace check
      wraps 2^31 ticks after the last ejection and suppresses ejections.
      (sashiko AI)

    - Track rescue_avg_at in jiffies_64 likewise - the unsigned long decay
      delta truncates mod 2^32 on 32-bit and can revive a weeks-old usage
      average in the victim pick.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
2026-08-03 11:01:36 -10:00
..
affinity.h
autogroup.h
clock.h sched/clock: Provide !HAVE_UNSTABLE_SCHED_CLOCK stub for sched_clock_stable() 2026-05-19 12:17:35 +02:00
cond_resched.h
coredump.h exec_state: relocate dumpable information 2026-05-26 11:02:01 +02:00
cpufreq.h
cputime.h
deadline.h cgroup/cpuset: Reserve DL bandwidth only for root-domain moves 2026-05-11 10:27:14 -10:00
debug.h
exec_state.h exec_state: relocate dumpable information 2026-05-26 11:02:01 +02:00
ext.h sched_ext: Eject the top rescue consumer on overload 2026-08-03 11:01:36 -10:00
hotplug.h
idle.h
init.h
isolation.h sched/isolation: Make HK_TYPE_KTHREAD an alias of HK_TYPE_DOMAIN 2026-05-05 01:52:55 +02:00
jobctl.h
loadavg.h
mm.h
nohz.h
numa_balancing.h
posix-timers.h
prio.h
rseq_api.h
rt.h
sd_flags.h
signal.h Locking updates for v7.1: 2026-04-14 12:36:25 -07:00
smt.h sched: Simplify ifdeffery around cpu_smt_mask 2026-05-19 12:17:37 +02:00
stat.h
sysctl.h
task_flags.h
task_stack.h
task.h
thread_info_api.h
topology.h sched/topology: Allow multiple domains to claim sched_domain_shared 2026-05-19 13:35:36 +02:00
types.h
user.h
vhost_task.h
wake_q.h
xacct.h