[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <176901427445.510.16153450380853197689.tip-bot2@tip-bot2>
Date: Wed, 21 Jan 2026 16:51:14 -0000
From: "tip-bot2 for Vincent Guittot" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Samuel Wu <wusamuel@...gle.com>, Alex Hoh <Alex.Hoh@...iatek.com>,
Vincent Guittot <vincent.guittot@...aro.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject:
[tip: sched/urgent] sched/fair: Fix pelt clock sync when entering idle
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: 98c88dc8a1ace642d9021b103b28cba7b51e3abc
Gitweb: https://git.kernel.org/tip/98c88dc8a1ace642d9021b103b28cba7b51e3abc
Author: Vincent Guittot <vincent.guittot@...aro.org>
AuthorDate: Wed, 21 Jan 2026 17:33:17 +01:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Wed, 21 Jan 2026 17:46:08 +01:00
sched/fair: Fix pelt clock sync when entering idle
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.
Fixes: 17e3e88ed0b6 ("sched/fair: Fix pelt lost idle time detection")
Closes: https://lore.kernel.org/all/CAG2KctpO6VKS6GN4QWDji0t92_gNBJ7HjjXrE+6H+RwRXt=iLg@mail.gmail.com/
Closes: https://lore.kernel.org/all/8cf19bf0e0054dcfed70e9935029201694f1bb5a.camel@mediatek.com/
Reported-by: Samuel Wu <wusamuel@...gle.com>
Reported-by: Alex Hoh <Alex.Hoh@...iatek.com>
Signed-off-by: Vincent Guittot <vincent.guittot@...aro.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Tested-by: Samuel Wu <wusamuel@...gle.com>
Tested-by: Alex Hoh <Alex.Hoh@...iatek.com>
Link: https://patch.msgid.link/20260121163317.505635-1-vincent.guittot@linaro.org
---
kernel/sched/fair.c | 6 ------
kernel/sched/idle.c | 6 ++++++
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index e713022..a148c61 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -8995,12 +8995,6 @@ idle:
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;
}
diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c
index c174afe..abf8f15 100644
--- a/kernel/sched/idle.c
+++ b/kernel/sched/idle.c
@@ -468,6 +468,12 @@ static void set_next_task_idle(struct rq *rq, struct task_struct *next, bool fir
scx_update_idle(rq, true, true);
schedstat_inc(rq->sched_goidle);
next->se.exec_start = rq_clock_task(rq);
+
+ /*
+ * 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);
}
struct task_struct *pick_task_idle(struct rq *rq, struct rq_flags *rf)
Powered by blists - more mailing lists