[PATCH v2 02/15] sched/core: Clear prev->dl_server in CFS pick fast path

Joel Fernandes (Google) posted 15 patches 1 year, 11 months ago
[PATCH v2 02/15] sched/core: Clear prev->dl_server in CFS pick fast path
Posted by Joel Fernandes (Google) 1 year, 11 months ago
From: Youssef Esmat <youssefesmat@google.com>

In case the previous pick was a DL server pick, ->dl_server might be
set. Clear it in the fast path as well.

Signed-off-by: Youssef Esmat <youssefesmat@google.com>
Signed-off-by: Joel Fernandes (Google) <joel@joelfernandes.org>
---
 kernel/sched/core.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 7f3a2596c1ed..63f41453b79e 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6036,6 +6036,13 @@ __pick_next_task(struct rq *rq, struct task_struct *prev, struct rq_flags *rf)
 			p = pick_next_task_idle(rq);
 		}
 
+		/*
+		 * This is a normal CFS pick, but the previous could be a DL pick.
+		 * Clear it as previous is no longer picked.
+		 */
+		if (prev->dl_server)
+			prev->dl_server = NULL;
+
 		/*
 		 * This is the fast path; it cannot be a DL server pick;
 		 * therefore even if @p == @prev, ->dl_server must be NULL.
-- 
2.34.1
Re: [PATCH v2 02/15] sched/core: Clear prev->dl_server in CFS pick fast path
Posted by Daniel Bristot de Oliveira 1 year, 10 months ago
On 3/13/24 02:24, Joel Fernandes (Google) wrote:
> From: Youssef Esmat <youssefesmat@google.com>
> 
> In case the previous pick was a DL server pick, ->dl_server might be
> set. Clear it in the fast path as well.
> 
> Signed-off-by: Youssef Esmat <youssefesmat@google.com>

Makes sense, I added the code to the v6.... embedded in the patch it fixes.

Thanks!
-- Daniel