Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162036AbbBDSjq (ORCPT ); Wed, 4 Feb 2015 13:39:46 -0500 Received: from foss-mx-na.foss.arm.com ([217.140.108.86]:41609 "EHLO foss-mx-na.foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161243AbbBDSbS (ORCPT ); Wed, 4 Feb 2015 13:31:18 -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 21/48] sched: Make energy awareness a sched feature Date: Wed, 4 Feb 2015 18:30:58 +0000 Message-Id: <1423074685-6336-22-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: 2076 Lines: 65 This patch introduces the ENERGY_AWARE sched feature, which is implemented using jump labels when SCHED_DEBUG is defined. It is statically set false when SCHED_DEBUG is not defined. Hence this doesn't allow energy awareness to be enabled without SCHED_DEBUG. This sched_feature knob will be replaced later with a more appropriate control knob when things have matured a bit. ENERGY_AWARE is based on per-entity load-tracking hence FAIR_GROUP_SCHED must be enable. This dependency isn't checked at compile time yet. cc: Ingo Molnar cc: Peter Zijlstra Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 6 ++++++ kernel/sched/features.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 33d3d81..2557774 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4554,6 +4554,7 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) return wl; } + #else static long effective_load(struct task_group *tg, int cpu, long wl, long wg) @@ -4563,6 +4564,11 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg) #endif +static inline bool energy_aware(void) +{ + return sched_feat(ENERGY_AWARE); +} + static int wake_wide(struct task_struct *p) { int factor = this_cpu_read(sd_llc_size); diff --git a/kernel/sched/features.h b/kernel/sched/features.h index 90284d1..199ee3a 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -83,3 +83,9 @@ SCHED_FEAT(NUMA_FAVOUR_HIGHER, true) */ SCHED_FEAT(NUMA_RESIST_LOWER, false) #endif + +/* + * Energy aware scheduling. Use platform energy model to guide scheduling + * decisions optimizing for energy efficiency. + */ +SCHED_FEAT(ENERGY_AWARE, false) -- 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/