mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: brookxu <brookxu.cn@gmail.com>
To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com,
	vincent.guittot@linaro.org, dietmar.eggemann@arm.com,
	rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de,
	bristot@redhat.com
Cc: linux-kernel@vger.kernel.org
Subject: [RFC PATCH] sched/fair: use max_spare_cap_cpu if it is more energy efficient
Date: Thu, 21 Oct 2021 16:23:14 +0800	[thread overview]
Message-ID: <1634804594-4163-1-git-send-email-brookxu.cn@gmail.com> (raw)

From: Chunguang Xu <brookxu@tencent.com>

When debugging EAS, I found that if the task is migrated to
max_spare_cap_cpu, even if the power consumption of pd is lower,
we still put the task on prev_cpu. Maybe we should fix it.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
---
 kernel/sched/fair.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index ff69f245b939..2ae7e03de6d2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6867,8 +6867,10 @@ static int find_energy_efficient_cpu(struct task_struct *p, int prev_cpu)
 		/* Evaluate the energy impact of using max_spare_cap_cpu. */
 		if (max_spare_cap_cpu >= 0) {
 			cur_delta = compute_energy(p, max_spare_cap_cpu, pd);
-			if (cur_delta < base_energy_pd)
+			if (cur_delta < base_energy_pd) {
+				target = max_spare_cap_cpu;
 				goto unlock;
+			}
 			cur_delta -= base_energy_pd;
 			if (cur_delta < best_delta) {
 				best_delta = cur_delta;
-- 
2.30.0


             reply	other threads:[~2021-10-21  8:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-21  8:23 brookxu [this message]
2021-10-22  4:05 ` Xuewen Yan
2021-10-25 13:04   ` Dietmar Eggemann
2021-10-28  2:08     ` brookxu

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=1634804594-4163-1-git-send-email-brookxu.cn@gmail.com \
    --to=brookxu.cn@gmail.com \
    --cc=bristot@redhat.com \
    --cc=bsegall@google.com \
    --cc=dietmar.eggemann@arm.com \
    --cc=juri.lelli@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --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

all inboxes | Powered by JetHome®