linux/kernel/sched
John Stultz cd8e62c858 sched: deadline: Add dl_rq->curr pointer to address issues with Proxy Exec
The DL scheduler keeps the current task in the rbtree, since
the deadline value isn't usually chagned while the task is
runnable.

This results in set_next_task() and put_prev_task() being
simpler, but unfortunately this causes complexity elsewhere.

Specifically when update_curr_dl() updates the deadline, it has
to dequeue and then enqueue the task.

From put_prev_task_dl(), we first call update_curr_dl(), and
then call enqueue_pushable_dl_task().

However, with Proxy Exec this goes awry. Since when a mutex is
released, we might wake the waiting rq->donor. This will cause
put_prev_task() to be called on the donor to take it off the
cpu for return migration.

At that point, from put_prev_task_dl() the update_curr_dl()
logic will dequeue & enqueue the task, and the enqueue function
will call enqueue_pushable_dl_task() (since the task_current()
check won't prevent it). Then back up the callstack in
put_prev_task_dl() we'll end up calling
enqueue_pushable_dl_task() again, tripping the
!RB_EMPTY_NODE(&p->pushable_dl_tasks) warning.

So to avoid this, use Peter's suggested[1] approach, and add a
dl_rq->curr pointer that is set/cleared from set_next_task()/
put_prev_task(), which effectively tracks the rq->donor. We can
then use this to avoid adding the active donor to the pushable
list from enqueue_task_dl().

[1]: https://lore.kernel.org/lkml/20260304095123.GP606826@noisy.programming.kicks-ass.net/

Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: John Stultz <jstultz@google.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260512025635.2840817-4-jstultz@google.com
2026-06-02 12:26:06 +02:00
..
autogroup.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
autogroup.h
build_policy.c
build_utility.c
clock.c sched/clock: Avoid false sharing for sched_clock_irqtime 2026-02-03 12:04:19 +01:00
completion.c
core_sched.c sched: Unify SMT active check via sched_smt_active() 2026-05-19 12:17:37 +02:00
core.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
cpuacct.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpudeadline.h
cpufreq_schedutil.c cpufreq: Pass the policy to cpufreq_driver->adjust_perf() 2026-04-02 11:30:24 -05:00
cpufreq.c
cpupri.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
cpupri.h
cputime.c sched/cputime: Drop now-stale mul_u64_u64_div_u64() over-approximation guard 2026-05-19 12:17:35 +02:00
deadline.c sched: deadline: Add dl_rq->curr pointer to address issues with Proxy Exec 2026-06-02 12:26:06 +02:00
debug.c sched/deadline: Reject debugfs dl_server writes for offline CPUs 2026-05-29 12:43:15 +02:00
ext_idle.c sched: Simplify ifdeffery around cpu_smt_mask 2026-05-19 12:17:37 +02:00
ext_idle.h sched_ext: Deny SCX kfuncs to non-SCX struct_ops programs 2026-04-20 07:57:29 -10:00
ext_internal.h sched_ext: Make bypass LB cpumasks per-scheduler 2026-04-24 14:31:36 -10:00
ext.c sched_ext: Auto-register/unregister dl_server reservations 2026-05-29 12:43:15 +02:00
ext.h sched_ext: Add @kargs to scx_fork() 2026-03-06 07:58:02 -10:00
fair.c Merge branch 'tip/sched/urgent' 2026-06-02 12:26:04 +02:00
features.h sched/rt: Have RT_PUSH_IPI be default off for non PREEMPT_RT 2026-05-19 12:17:39 +02:00
idle.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
isolation.c cgroup/cpuset: Call housekeeping_update() without holding cpus_read_lock 2026-02-23 10:46:49 -10:00
loadavg.c
Makefile sched: Enable context analysis for core.c and fair.c 2026-01-05 16:43:36 +01:00
membarrier.c rseq: Revert to historical performance killing behaviour 2026-05-05 16:02:57 +02:00
pelt.c treewide: Update email address 2026-01-11 06:09:11 -10:00
pelt.h
psi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
rq-offsets.c
rt.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
sched-pelt.h
sched.h sched: deadline: Add dl_rq->curr pointer to address issues with Proxy Exec 2026-06-02 12:26:06 +02:00
smp.h
stats.c
stats.h delayacct: add timestamp of delay max 2026-01-31 16:16:06 -08:00
stop_task.c sched: Rework prev_balance() to avoid stale prev references 2026-06-02 12:26:06 +02:00
swait.c
syscalls.c Linux 7.0-rc4 2026-03-17 07:14:42 +01:00
topology.c sched/topology: Provide arch_llc_mask for cache aware scheduling 2026-05-29 12:43:15 +02:00
wait_bit.c
wait.c