[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1400869003-27769-15-git-send-email-morten.rasmussen@arm.com>
Date: Fri, 23 May 2014 19:16:41 +0100
From: Morten Rasmussen <morten.rasmussen@....com>
To: linux-kernel@...r.kernel.org, linux-pm@...r.kernel.org,
peterz@...radead.org, mingo@...nel.org
Cc: rjw@...ysocki.net, vincent.guittot@...aro.org,
daniel.lezcano@...aro.org, preeti@...ux.vnet.ibm.com,
dietmar.eggemann@....com
Subject: [RFC PATCH 14/16] sched: Use energy model in select_idle_sibling
Make select_idle_sibling() consider energy when picking an idle cpu.
Only idle cpus are still considered. A more aggressive energy conserving
approach could go further and consider partly utilized cpus.
Signed-off-by: Morten Rasmussen <morten.rasmussen@....com>
---
kernel/sched/fair.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 5a52467..542c2b2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -4644,7 +4644,9 @@ static int select_idle_sibling(struct task_struct *p, int target)
struct sched_domain *sd;
struct sched_group *sg;
int i = task_cpu(p);
+ int target_energy;
+#ifndef CONFIG_SCHED_ENERGY
if (idle_cpu(target))
return target;
@@ -4653,6 +4655,8 @@ static int select_idle_sibling(struct task_struct *p, int target)
*/
if (i != target && cpus_share_cache(i, target) && idle_cpu(i))
return i;
+#endif
+ target_energy = energy_diff_task(target, p);
/*
* Otherwise, iterate the domains and find an elegible idle cpu.
@@ -4666,8 +4670,12 @@ static int select_idle_sibling(struct task_struct *p, int target)
goto next;
for_each_cpu(i, sched_group_cpus(sg)) {
+ int diff;
if (i == target || !idle_cpu(i))
goto next;
+ diff = energy_diff_task(i, p);
+ if (diff > target_energy)
+ goto next;
}
target = cpumask_first_and(sched_group_cpus(sg),
--
1.7.9.5
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists