Re: [PATCH v25 1/9] sched: Make class_schedulers avoid pushing current, and get rid of proxy_tag_curr()

From: John Stultz

Date: Fri Mar 13 2026 - 13:57:10 EST


On Fri, Mar 13, 2026 at 6:48 AM Juri Lelli <juri.lelli@xxxxxxxxxx> wrote:
>
> Hello,
>
> On 13/03/26 02:30, John Stultz wrote:
>
> ...
>
> > diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> > index d08b004293234..4e746f4de6529 100644
> > --- a/kernel/sched/deadline.c
> > +++ b/kernel/sched/deadline.c
> > @@ -2801,12 +2801,24 @@ static int find_later_rq(struct task_struct *task)
> >
> > static struct task_struct *pick_next_pushable_dl_task(struct rq *rq)
> > {
> > - struct task_struct *p;
> > + struct task_struct *p = NULL;
> > + struct rb_node *next_node;
> >
> > if (!has_pushable_dl_tasks(rq))
> > return NULL;
> >
> > - p = __node_2_pdl(rb_first_cached(&rq->dl.pushable_dl_tasks_root));
> > + next_node = rb_first_cached(&rq->dl.pushable_dl_tasks_root);
> > + while (next_node) {
> > + p = __node_2_pdl(next_node);
> > + /* make sure task isn't on_cpu (possible with proxy-exec) */
> > + if (!task_on_cpu(rq, p))
> > + break;
> > +
> > + next_node = rb_next(next_node);
> > + }
> > +
> > + if (!p)
> > + return NULL;
>
> Can't this return an on_cpu task if we hit the corner case where all
> pushable tasks are on_cpu?
>

Oof. Yep. Thanks for catching this!

Let me know if you have any feedback on the rest of the series. I'll
try reviewers a chance to catch anything else, and will respin this
next week.

Really appreciate the review!
thanks
-john