Re: [RFC PATCH v5 13/29] sched/rt: Implement dl-server operations for rt-cgroups

Peter Zijlstra
2026-05-05T13:04:16Z

On Thu, Apr 30, 2026 at 11:38:17PM +0200, Yuri Andriaccio wrote:
> +static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq);
> +static inline void set_next_task_rt(struct rq *rq, struct task_struct *p, bool first);
> +
> static struct task_struct *rt_server_pick(struct sched_dl_entity *dl_se, struct rq_flags *rf)
> {
> - return NULL;
> + struct rt_rq *rt_rq = &dl_se->my_q->rt;
> + struct rq *rq = rq_of_rt_rq(rt_rq);
> + struct task_struct *p;
> +
> + if (!sched_rt_runnable(dl_se->my_q))
> + return NULL;
> +
> + p = rt_task_of(pick_next_rt_entity(rt_rq));
> + set_next_task_rt(rq, p, true);
> +
> + return p;
> }

set_next_task_rt() should not be needed at this point. There is only a
single ->pick_next_task() implementation left, and that will soon go
away too. All ->pick_task() methods are idempotent.

[ https://lore.kernel.org/r/20260317104343.225156112@infradead.org ]

Notably, see core.c:__pick_next_task(), it will take care of
set_next_task() through put_prev_set_next_task() after calling
class->pick_task().