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

Juri Lelli
2026-03-13T13:48:19Z

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?

Thanks,
Juri