[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240820163512.1096301-16-qyousef@layalina.io>
Date: Tue, 20 Aug 2024 17:35:11 +0100
From: Qais Yousef <qyousef@...alina.io>
To: Ingo Molnar <mingo@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Vincent Guittot <vincent.guittot@...aro.org>,
"Rafael J. Wysocki" <rafael@...nel.org>,
Viresh Kumar <viresh.kumar@...aro.org>
Cc: Juri Lelli <juri.lelli@...hat.com>,
Steven Rostedt <rostedt@...dmis.org>,
Dietmar Eggemann <dietmar.eggemann@....com>,
John Stultz <jstultz@...gle.com>,
linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org,
Qais Yousef <qyousef@...alina.io>
Subject: [RFC PATCH 15/16] sched/fair: Enable disabling util_est via rampup_multiplier
util_est is a great feature to enable busy tasks with long sleep time to
maintain their perf level. But it can also be expensive in terms of
power for tasks that have no such perf requirements and just happened to
be busy in the last activation.
If a task sets its rampup_multiplier to 0, then it indicates that it is
happy to glide along with system default response and doesn't require
responsiveness. We can use that to further imply that the task is happy
to decay its util for long sleep too and disable util_est.
XXX: This could be overloading this QoS. We could add a separate more
explicit QoS to disable util_est for tasks that don't care.
Signed-off-by: Qais Yousef <qyousef@...alina.io>
---
kernel/sched/fair.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index a8dbba0b755e..ad72db5a266c 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4918,6 +4918,14 @@ static inline void util_est_update(struct cfs_rq *cfs_rq,
if (!sched_feat(UTIL_EST))
return;
+ /*
+ * rampup_multiplier = 0 indicates util_est is disabled.
+ */
+ if (!p->sched_qos.rampup_multiplier) {
+ ewma = 0;
+ goto done;
+ }
+
/* Get current estimate of utilization */
ewma = READ_ONCE(p->se.avg.util_est);
--
2.34.1
Powered by blists - more mailing lists