From: "tip-bot2 for Qais Yousef" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: "Qais Yousef (Google)" <qyousef@layalina.io>,
Ingo Molnar <mingo@kernel.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0
Date: Fri, 29 Sep 2023 08:39:01 -0000 [thread overview]
Message-ID: <169597674169.27769.13480580087727084162.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20230916232955.2099394-3-qyousef@layalina.io>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 23c9519def98ee0fa97ea5871535e9b136f522fc
Gitweb: https://git.kernel.org/tip/23c9519def98ee0fa97ea5871535e9b136f522fc
Author: Qais Yousef <qyousef@layalina.io>
AuthorDate: Sun, 17 Sep 2023 00:29:54 +01:00
Committer: Ingo Molnar <mingo@kernel.org>
CommitterDate: Fri, 29 Sep 2023 10:29:14 +02:00
sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0
find_energy_efficient_cpu() bails out early if effective util of the
task is 0 as the delta at this point will be zero and there's nothing
for EAS to do. When uclamp is being used, this could lead to wrong
decisions when uclamp_max is set to 0. In this case the task is capped
to performance point 0, but it is actually running and consuming energy
and we can benefit from EAS energy calculations.
Rework the condition so that it bails out when both util and uclamp_min
are 0.
We can do that without needing to use uclamp_task_util(); remove it.
Fixes: d81304bc6193 ("sched/uclamp: Cater for uclamp in find_energy_efficient_cpu()'s early exit condition")
Signed-off-by: Qais Yousef (Google) <qyousef@layalina.io>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20230916232955.2099394-3-qyousef@layalina.io
---
kernel/sched/fair.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 4ce949b..284b0ab 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4558,22 +4558,6 @@ static inline unsigned long task_util_est(struct task_struct *p)
return max(task_util(p), _task_util_est(p));
}
-#ifdef CONFIG_UCLAMP_TASK
-static inline unsigned long uclamp_task_util(struct task_struct *p,
- unsigned long uclamp_min,
- unsigned long uclamp_max)
-{
- return clamp(task_util_est(p), uclamp_min, uclamp_max);
-}
-#else
-static inline unsigned long uclamp_task_util(struct task_struct *p,
- unsigned long uclamp_min,
- unsigned long uclamp_max)
-{
- return task_util_est(p);
-}
-#endif
-
static inline void util_est_enqueue(struct cfs_rq *cfs_rq,
struct task_struct *p)
{
@@ -7695,7 +7679,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
target = prev_cpu;
sync_entity_load_avg(&p->se);
- if (!uclamp_task_util(p, p_util_min, p_util_max))
+ if (!task_util_est(p) && p_util_min == 0)
goto unlock;
eenv_task_busy_time(&eenv, p, prev_cpu);
next prev parent reply other threads:[~2023-09-29 8:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-16 23:29 [PATCH v5 0/3] Fix a couple of corner cases in feec() when using uclamp_max Qais Yousef
2023-09-16 23:29 ` [PATCH v5 1/3] sched/uclamp: Set max_spare_cap_cpu even if max_spare_cap is 0 Qais Yousef
2023-09-29 8:39 ` [tip: sched/core] " tip-bot2 for Qais Yousef
2023-09-16 23:29 ` [PATCH v5 2/3] sched/uclamp: Ignore (util == 0) optimization in feec() when p_util_max = 0 Qais Yousef
2023-09-29 8:39 ` tip-bot2 for Qais Yousef [this message]
2023-09-16 23:29 ` [PATCH v5 3/3] sched/tp: Add new tracepoint to track compute energy computation Qais Yousef
2023-09-29 8:39 ` [tip: sched/core] sched/debug: " tip-bot2 for Qais Yousef
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=169597674169.27769.13480580087727084162.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=qyousef@layalina.io \
--cc=vincent.guittot@linaro.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®