All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] sched/fair: use max_spare_cap_cpu if it is more energy efficient
@ 2021-10-21  8:23 brookxu
  2021-10-22  4:05 ` Xuewen Yan
  0 siblings, 1 reply; 4+ messages in thread
From: brookxu @ 2021-10-21  8:23 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot
  Cc: linux-kernel

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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-10-28  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21  8:23 [RFC PATCH] sched/fair: use max_spare_cap_cpu if it is more energy efficient brookxu
2021-10-22  4:05 ` Xuewen Yan
2021-10-25 13:04   ` Dietmar Eggemann
2021-10-28  2:08     ` brookxu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.