Re: [PATCH 06/10] sched: server: Don't start hrtick for DL server tasks

From: Daniel Bristot de Oliveira
Date: Wed Feb 21 2024 - 03:40:17 EST


On 2/16/24 19:31, Joel Fernandes (Google) wrote:
> From: Suleiman Souhlal <suleiman@xxxxxxxxxx>
>
> Otherwise, we might start it even for tasks in a sched class that should
> have it off.

If the task is fair, but it is running inside a DL reservation, we want the
hrtick for the dl reservation.

This is one of the reasons why we are moving to the DL server, having microseconds
granularity for the boost duration (runtime).

-- Daniel

>
> Signed-off-by: Suleiman Souhlal <suleiman@xxxxxxxxxx>
> ---
> kernel/sched/deadline.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c
> index 8fafe3f8b59c..5adfc15803c3 100644
> --- a/kernel/sched/deadline.c
> +++ b/kernel/sched/deadline.c
> @@ -2325,11 +2325,12 @@ static struct task_struct *pick_next_task_dl(struct rq *rq)
> if (!p)
> return p;
>
> - if (!p->dl_server)
> + if (!p->dl_server) {
> set_next_task_dl(rq, p, true);
>
> - if (hrtick_enabled(rq))
> - start_hrtick_dl(rq, &p->dl);
> + if (hrtick_enabled(rq))
> + start_hrtick_dl(rq, &p->dl);
> + }
>
> return p;
> }