sched/fair: Fix pelt clock sync when entering idle
PATCH 1/1 sched/fair: Fix pelt clock sync when entering idle
From: Vincent Guittot <[email protected]>
[ Upstream commit 98c88dc8a1ace642d9021b103b28cba7b51e3abc ]
Samuel and Alex reported regressions of the util_avg of RT rq with commit 17e3e88ed0b6 ("sched/fair: Fix pelt lost idle time detection"). It happens that fair is updating and syncing the pelt clock with task one when pick_next_task_fair() fails to pick a task but before the prev scheduling class got a chance to update its pelt signals.
Move update_idle_rq_clock_pelt() in set_next_task_idle() which is called after prev class has been called.
[ wusamuel: Did not include line 'exec_start = rq_clock_task()', which is not present in 6.6.y but found in mainline ]
--- kernel/sched/fair.c | 6 ------ kernel/sched/idle.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-)
kernel/sched/fair.c +0 -6
@@ -8557,12 +8557,6 @@ done: __maybe_unused; goto again; } -/* -* rq is about to be idle, check if we need to update the -* lost_idle_time of clock_pelt -*/ -update_idle_rq_clock_pelt (rq); -return NULL ; }
kernel/sched/idle.c +6 -0
@@ -414,6 +414,12 @@ static void set_next_task_idle(struct rq *rq, struct task_struct *next, bool fir {update_idle_core (rq);schedstat_inc (rq->sched_goidle); + +/* +* rq is about to be idle, check if we need to update the +* lost_idle_time of clock_pelt +*/ +update_idle_rq_clock_pelt (rq); }#ifdef CONFIG_SMP
Signature · 1 line
2.53.0.473.g4a7958ca14-goog
PATCH 1/1 sched/fair: Fix pelt clock sync when entering idle
From: Vincent Guittot <[email protected]>
[ Upstream commit 98c88dc8a1ace642d9021b103b28cba7b51e3abc ]
Samuel and Alex reported regressions of the util_avg of RT rq with commit 17e3e88ed0b6 ("sched/fair: Fix pelt lost idle time detection"). It happens that fair is updating and syncing the pelt clock with task one when pick_next_task_fair() fails to pick a task but before the prev scheduling class got a chance to update its pelt signals.
Move update_idle_rq_clock_pelt() in set_next_task_idle() which is called after prev class has been called.
[ wusamuel: Did not include line 'exec_start = rq_clock_task()', which is not present in 6.1.y but found in mainline ]
--- kernel/sched/fair.c | 6 ------ kernel/sched/idle.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-)
kernel/sched/fair.c +0 -6
@@ -7924,12 +7924,6 @@ done: __maybe_unused; goto again; } -/* -* rq is about to be idle, check if we need to update the -* lost_idle_time of clock_pelt -*/ -update_idle_rq_clock_pelt (rq); -return NULL ; }
kernel/sched/idle.c +6 -0
@@ -435,6 +435,12 @@ static void set_next_task_idle(struct rq *rq, struct task_struct *next, bool fir {update_idle_core (rq);schedstat_inc (rq->sched_goidle); + +/* +* rq is about to be idle, check if we need to update the +* lost_idle_time of clock_pelt +*/ +update_idle_rq_clock_pelt (rq); }#ifdef CONFIG_SMP
Signature · 1 line
2.53.0.473.g4a7958ca14-goog