aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDietmar Eggemann <dietmar.eggemann@arm.com>2015-01-20 11:22:35 +0000
committerRobin Randhawa <robin.randhawa@arm.com>2015-04-09 12:26:14 +0100
commit9c9aa32e3c08cbba3c77bac58fa332ef5b731b05 (patch)
treee9228bdbae7d4615203da12215a9f7180e53dd48
parentc40def01b8951335927c4d7b7f4c4ff744cc36e9 (diff)
sched: Introduce energy awareness into update_sg_lb_stats
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@redhat.com> cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
-rw-r--r--kernel/sched/fair.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index f49a4cb35e57..1bbb896346b3 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -5908,6 +5908,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;
@@ -6263,6 +6264,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;
+ }
}
/**