Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161891AbbBDSf6 (ORCPT ); Wed, 4 Feb 2015 13:35:58 -0500 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:41662 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161733AbbBDSbj (ORCPT ); Wed, 4 Feb 2015 13:31:39 -0500 From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: vincent.guittot@linaro.org, dietmar.eggemann@arm.com, yuyang.du@intel.com, preeti@linux.vnet.ibm.com, mturquette@linaro.org, nico@linaro.org, rjw@rjwysocki.net, juri.lelli@arm.com, linux-kernel@vger.kernel.org Subject: [RFCv3 PATCH 39/48] sched: Introduce energy awareness into update_sg_lb_stats Date: Wed, 4 Feb 2015 18:31:16 +0000 Message-Id: <1423074685-6336-40-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1423074685-6336-1-git-send-email-morten.rasmussen@arm.com> References: <1423074685-6336-1-git-send-email-morten.rasmussen@arm.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1776 Lines: 57 From: Dietmar Eggemann 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 cc: Peter Zijlstra Signed-off-by: Dietmar Eggemann --- 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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/