Re: [RFC PATCH v4 12/28] sched/rt: Implement dl-server operations for rt-cgroups.

From: Juri Lelli

Date: Mon Jan 19 2026 - 10:01:40 EST


Hello,

On 01/12/25 13:41, Yuri Andriaccio wrote:
> - Implement rt_server_pick, the callback that deadline servers use to
> pick a task to schedule.
> - rt_server_pick(): pick the next runnable rt task and tell the
> scheduler that it is going to be scheduled next.
>
> - Let enqueue/dequeue_task_rt function start/stop the attached deadline
> server when the first/last task is enqueued/dequeued on a specific
> rq/server.
>
> - Change update_curr_rt to perform a deadline server update if the
> updated task is served by non-root group.
>
> - Update inc/dec_dl_tasks to account the number of active tasks in the
> local runqueue for rt-cgroups servers, as their local runqueue is
> different from the global runqueue, and thus when a rt-group server is
> activated/deactivated, the number of served tasks' must be
> added/removed. This uses nr_running to be compatible with future
> dl-server interfaces.
>
> - Update inc/dec_rt_prio_smp to change a rq's cpupri only if the rt_rq
> is the global runqueue, since cgroups are scheduled via their
> dl-server priority.
>
> - Update inc/dec_rt_tasks to account for waking/sleeping tasks on the
> global runqueue, when the task runs on the root cgroup, or its local
> dl server is active. The accounting is not done when servers are
> throttled, as they will add/sub the number of tasks running when they
> get enqueued/dequeued. For rt cgroups, account for the number of active
> tasks in the nr_running field of the local runqueue
> (add/sub_nr_running), as this number is used when a dl server is
> enqueued/dequeued.
>
> - Update set_task_rq to record the dl_rq, tracking which deadline
> server manages a task.
>
> - Update set_task_rq to not use the parent field anymore, as it is
> unused by this patchset's code. Remove the unused parent field from
> sched_rt_entity.
>
> Co-developed-by: Alessio Balsini <a.balsini@xxxxxxxx>
> Signed-off-by: Alessio Balsini <a.balsini@xxxxxxxx>
> Co-developed-by: Andrea Parri <parri.andrea@xxxxxxxxx>
> Signed-off-by: Andrea Parri <parri.andrea@xxxxxxxxx>
> Co-developed-by: luca abeni <luca.abeni@xxxxxxxxxxxxxxx>
> Signed-off-by: luca abeni <luca.abeni@xxxxxxxxxxxxxxx>
> Signed-off-by: Yuri Andriaccio <yurand2000@xxxxxxxxx>
> ---

...

> /*
> @@ -725,6 +769,14 @@ enqueue_task_rt(struct rq *rq, struct task_struct *p, int flags)
> check_schedstat_required();
> update_stats_wait_start_rt(rt_rq_of_se(rt_se), rt_se);
>
> + /* Task arriving in an idle group of tasks. */
> + if (IS_ENABLED(CONFIG_RT_GROUP_SCHED) &&
^^^
Shall we be using rt_group_sched_enabled() here and elsewhere instead?

Thanks,
Juri