Re: [PATCH v2 10/10] sched/eevdf: Move to a single runqueue
From: John Stultz
Date: Wed May 13 2026 - 23:14:47 EST
On Wed, May 13, 2026 at 7:53 PM K Prateek Nayak <kprateek.nayak@xxxxxxx> wrote:
>
> On 5/14/2026 7:06 AM, John Stultz wrote:
> > So looking at the callstack when I see the failure:
> > proxy_find_task()
> > proxy_force_return()
> > proxy_resched_idle() <- sets rq->donor to idle
> > attach_one_task()
> > wakeup_preempt()
> > wakeup_preempt_fair()
>
> After this point, I would have expected we called idle class's
> wakeup_preempt() since that is the donor context ...
Ah, that's a good point! (I was getting muddied by the rq->idle having
SCHED_NORMAL policy value and assuming that was why we were in the
fair code).
> > update_protect_slice() <- called with the donor's se
> > calc_delta_fair()
> > __calc_delta() <- div by zero
> >
> > Basically we end up in wakeup_preempt_fair() with rq->donor ==
> > rq->idle because we earlier called proxy_resched_idle().
>
> Could you check if following makes things better:
>
> (Only build tested)
>
> diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> index 3ae5f19c1b7e..77f4ebe8f5c7 100644
> --- a/kernel/sched/core.c
> +++ b/kernel/sched/core.c
> @@ -6653,6 +6653,7 @@ static inline void proxy_set_task_cpu(struct task_struct *p, int cpu)
> static inline struct task_struct *proxy_resched_idle(struct rq *rq)
> {
> put_prev_set_next_task(rq, rq->donor, rq->idle);
> + rq->next_class = &idle_sched_class;
> rq_set_donor(rq, rq->idle);
> set_tsk_need_resched(rq->idle);
> return rq->idle;
Yeah, that looks to avoid the problem and is a fair bit cleaner. I
missed the introduction of the rq->next_class detail!
Thanks for pointing this out!
I'll do some testing against the full series and get a patch sent out here soon.
-john