[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <156957184084.9866.11941365250682911830.tip-bot2@tip-bot2>
Date: Fri, 27 Sep 2019 08:10:40 -0000
From: "tip-bot2 for Quentin Perret" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Pavan Kondeti <pkondeti@...eaurora.org>,
Quentin Perret <qperret@...rret.net>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Thomas Gleixner <tglx@...utronix.de>, dietmar.eggemann@....com,
juri.lelli@...hat.com, morten.rasmussen@....com,
qais.yousef@....com, rjw@...ysocki.net, tkjos@...gle.com,
valentin.schneider@....com, vincent.guittot@...aro.org,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
linux-kernel@...r.kernel.org
Subject: [tip: sched/urgent] sched/fair: Avoid redundant EAS calculation
The following commit has been merged into the sched/urgent branch of tip:
Commit-ID: 4892f51ad54ddff2883a60b6ad4323c1f632a9d6
Gitweb: https://git.kernel.org/tip/4892f51ad54ddff2883a60b6ad4323c1f632a9d6
Author: Quentin Perret <qperret@...rret.net>
AuthorDate: Fri, 20 Sep 2019 11:41:15 +02:00
Committer: Ingo Molnar <mingo@...nel.org>
CommitterDate: Wed, 25 Sep 2019 17:42:32 +02:00
sched/fair: Avoid redundant EAS calculation
The EAS wake-up path computes the system energy for several CPU
candidates: the CPU with maximum spare capacity in each performance
domain, and the prev_cpu. However, if prev_cpu also happens to be the
CPU with maximum spare capacity in its performance domain, the energy
calculation is still done twice, unnecessarily.
Add a condition to filter out this corner case before doing the energy
calculation.
Reported-by: Pavan Kondeti <pkondeti@...eaurora.org>
Signed-off-by: Quentin Perret <qperret@...rret.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: Peter Zijlstra <peterz@...radead.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: dietmar.eggemann@....com
Cc: juri.lelli@...hat.com
Cc: morten.rasmussen@....com
Cc: qais.yousef@....com
Cc: rjw@...ysocki.net
Cc: tkjos@...gle.com
Cc: valentin.schneider@....com
Cc: vincent.guittot@...aro.org
Fixes: eb92692b2544 ("sched/fair: Speed-up energy-aware wake-ups")
Link: https://lkml.kernel.org/r/20190920094115.GA11503@qperret.net
Signed-off-by: Ingo Molnar <mingo@...nel.org>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index dfdac90..83ab35e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6389,7 +6389,7 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
}
/* Evaluate the energy impact of using this CPU. */
- if (max_spare_cap_cpu >= 0) {
+ if (max_spare_cap_cpu >= 0 && max_spare_cap_cpu != prev_cpu) {
cur_delta = compute_energy(p, max_spare_cap_cpu, pd);
cur_delta -= base_energy_pd;
if (cur_delta < best_delta) {
Powered by blists - more mailing lists