From: "tip-bot2 for Quentin Perret" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Pavan Kondeti <pkondeti@codeaurora.org>,
Quentin Perret <qperret@qperret.net>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
dietmar.eggemann@arm.com, juri.lelli@redhat.com,
morten.rasmussen@arm.com, qais.yousef@arm.com, rjw@rjwysocki.net,
tkjos@google.com, valentin.schneider@arm.com,
vincent.guittot@linaro.org, Ingo Molnar <mingo@kernel.org>,
Borislav Petkov <bp@alien8.de>,
linux-kernel@vger.kernel.org
Subject: [tip: sched/urgent] sched/fair: Avoid redundant EAS calculation
Date: Fri, 27 Sep 2019 08:10:40 -0000 [thread overview]
Message-ID: <156957184084.9866.11941365250682911830.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20190920094115.GA11503@qperret.net>
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@qperret.net>
AuthorDate: Fri, 20 Sep 2019 11:41:15 +02:00
Committer: Ingo Molnar <mingo@kernel.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@codeaurora.org>
Signed-off-by: Quentin Perret <qperret@qperret.net>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: dietmar.eggemann@arm.com
Cc: juri.lelli@redhat.com
Cc: morten.rasmussen@arm.com
Cc: qais.yousef@arm.com
Cc: rjw@rjwysocki.net
Cc: tkjos@google.com
Cc: valentin.schneider@arm.com
Cc: vincent.guittot@linaro.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@kernel.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) {
prev parent reply other threads:[~2019-09-27 8:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-12 9:44 [PATCH] sched/fair: Speed-up energy-aware wake-ups Quentin Perret
2019-09-13 22:43 ` [tip: sched/core] " tip-bot2 for Quentin Perret
2019-09-20 3:02 ` [PATCH] " Pavan Kondeti
2019-09-20 9:41 ` Quentin Perret
2019-09-20 10:33 ` Pavan Kondeti
2019-09-20 11:23 ` Quentin Perret
2019-09-25 8:41 ` Peter Zijlstra
2019-09-27 8:10 ` tip-bot2 for Quentin Perret [this message]
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=156957184084.9866.11941365250682911830.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=bp@alien8.de \
--cc=dietmar.eggemann@arm.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=morten.rasmussen@arm.com \
--cc=peterz@infradead.org \
--cc=pkondeti@codeaurora.org \
--cc=qais.yousef@arm.com \
--cc=qperret@qperret.net \
--cc=rjw@rjwysocki.net \
--cc=tglx@linutronix.de \
--cc=tkjos@google.com \
--cc=torvalds@linux-foundation.org \
--cc=valentin.schneider@arm.com \
--cc=vincent.guittot@linaro.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;
as well as URLs for NNTP newsgroup(s).