[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1423074685-6336-40-git-send-email-morten.rasmussen@arm.com>
Date: Wed, 4 Feb 2015 18:31:16 +0000
From: Morten Rasmussen <morten.rasmussen@....com>
To: peterz@...radead.org, mingo@...hat.com
Cc: vincent.guittot@...aro.org, dietmar.eggemann@....com,
yuyang.du@...el.com, preeti@...ux.vnet.ibm.com,
mturquette@...aro.org, nico@...aro.org, rjw@...ysocki.net,
juri.lelli@....com, linux-kernel@...r.kernel.org
Subject: [RFCv3 PATCH 39/48] sched: Introduce energy awareness into update_sg_lb_stats
From: Dietmar Eggemann <dietmar.eggemann@....com>
To be able to identify the least efficient (costliest) sched group
introduce group_eff as the efficiency of the sched group into sg_lb_stats.
The group efficiency is defined as the ratio between the group usage and
the group energy consumption.
cc: Ingo Molnar <mingo@...hat.com>
cc: Peter Zijlstra <peterz@...radead.org>
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@....com>
---
kernel/sched/fair.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 45c784f..bfa335e 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -6345,6 +6345,7 @@ struct sg_lb_stats {
unsigned long load_per_task;
unsigned long group_capacity;
unsigned long group_usage; /* Total usage of the group */
+ unsigned long group_eff;
unsigned int sum_nr_running; /* Nr tasks running in the group */
unsigned int idle_cpus;
unsigned int group_weight;
@@ -6715,6 +6716,21 @@ static inline void update_sg_lb_stats(struct lb_env *env,
sgs->group_no_capacity = group_is_overloaded(env, sgs);
sgs->group_type = group_classify(env, group, sgs);
+
+ if (env->use_ea) {
+ struct energy_env eenv = {
+ .sg_top = group,
+ .usage_delta = 0,
+ .src_cpu = -1,
+ .dst_cpu = -1,
+ };
+ unsigned long group_energy = sched_group_energy(&eenv);
+
+ if (group_energy)
+ sgs->group_eff = 1024*sgs->group_usage/group_energy;
+ else
+ sgs->group_eff = ULONG_MAX;
+ }
}
/**
--
1.9.1
--
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