[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1634804594-4163-1-git-send-email-brookxu.cn@gmail.com>
Date: Thu, 21 Oct 2021 16:23:14 +0800
From: brookxu <brookxu.cn@...il.com>
To: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com,
vincent.guittot@...aro.org, dietmar.eggemann@....com,
rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
bristot@...hat.com
Cc: linux-kernel@...r.kernel.org
Subject: [RFC PATCH] sched/fair: use max_spare_cap_cpu if it is more energy efficient
From: Chunguang Xu <brookxu@...cent.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@...cent.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
Powered by blists - more mailing lists