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

Message ID 20240216183108.1564958-7-joel@joelfernandes.org
State New
Headers
Series Fair scheduling deadline server fixes |

Commit Message

Joel Fernandes Feb. 16, 2024, 6:31 p.m. UTC
  From: Suleiman Souhlal <suleiman@google.com>

Otherwise, we might start it even for tasks in a sched class that should
have it off.

Signed-off-by: Suleiman Souhlal <suleiman@google.com>
---
 kernel/sched/deadline.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
  

Comments

Daniel Bristot de Oliveira Feb. 21, 2024, 8:39 a.m. UTC | #1
On 2/16/24 19:31, Joel Fernandes (Google) wrote:
> From: Suleiman Souhlal <suleiman@google.com>
> 
> 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@google.com>
> ---
>  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;
>  }
  

Patch

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;
 }