Re: [PATCH sched/urgent] sched/deadline: Fix stale rq->dl_server after a server pick returns RETRY_TASK

From: Juri Lelli

Date: Mon Nov 02 2026 - 09:14:03 EST


On 30/10/26 13:56, Tejun Heo wrote:
> On Fri, Oct 30, 2026 at 12:18:42PM -1000, Tejun Heo wrote:
> > __pick_task_dl() records the server in rq->dl_server whenever the server's
> > pick returns non-NULL, RETRY_TASK included. __pick_next_task() clears
> > rq->dl_server at its top, but a RETRY_TASK restarts the pick below that
> > clear. put_prev_set_next_task() then hands the stale server to whatever the
> > restarted pick takes.
> >
> > Since b3a2dfa8b42e ("sched/fair: Add newidle balance to pick_task_fair()"),
> > fair_server_pick_task() returns RETRY_TASK when the newidle balance released
> > the rq lock and a higher class task was enqueued meanwhile.
> >
> > That task, an RT task for example, then carries the fair server in
> > p->dl_server until it is next put. The RV deadline monitors see the fair
> > server switch in with it, and core scheduling, if enabled meanwhile, treats
> > the task as deadline priority.
> >
> > Don't record the server when its pick returns RETRY_TASK. The restarted pick
> > records whichever server it goes through, if any.
> >
> > Verified with a synthetic reproducer.
> >
> > Fixes: b3a2dfa8b42e ("sched/fair: Add newidle balance to pick_task_fair()")
> > Signed-off-by: Tejun Heo <tj@xxxxxxxxxx>
>
> Ugh, please ignore this one. Sent out the wrong patch. I'll test Juri's.

uhu, don't think any of my recently shared patches deal with this case?
:)

Thanks,
Juri