From patchwork Thu Jul 3 16:25:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 33054 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f197.google.com (mail-ie0-f197.google.com [209.85.223.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4D57A203AC for ; Thu, 3 Jul 2014 16:33:02 +0000 (UTC) Received: by mail-ie0-f197.google.com with SMTP id rd18sf2158191iec.4 for ; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type :content-transfer-encoding; bh=1oj2kYpOzuPiY7DuosKKMwAW2Ct59HlMB19EFqMpj7U=; b=FhhYOkInytap6mBVVmeWo0boXWjCFDRlE+gbIxwLtcw6E6SRAB85CdU14w46T3xM+V v+ZN35mmridSviMBZA7Bb1YV+ZJ2+y8JmJ4pKkzwbvZ7RfEwjRj116WN+6gy7y2F6KmJ HqeoXqjmfy6OvbURLNCdiN+mdgI8iPvai+DUGSNVguTNEOR88zKmN/Pg6d1iaBVW6dEt i8ESoTwq7bWsPQBPre8upSgMBZx2b+EEjN3G3z+vBLBZCz+1SjvZNvxQTmgs52v6eSyM q9xRL/zbC/lXlJZ4B8MIuapcFcAQD/oc6kB42J8jXS/iuv0MU9g4AEFSnBNdKl9uMALT NP+Q== X-Gm-Message-State: ALoCoQk+OTel7d9iWFIky/cZp/VExloBRJIdJ+1jS7WDNWP3i3MX5x+NdS8tNNYGVUA+tGuJ8jaY X-Received: by 10.43.151.207 with SMTP id kt15mr5205110icc.15.1404405181932; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.80.114 with SMTP id b105ls559635qgd.16.gmail; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) X-Received: by 10.52.117.209 with SMTP id kg17mr4079124vdb.28.1404405181816; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) Received: from mail-ve0-f179.google.com (mail-ve0-f179.google.com [209.85.128.179]) by mx.google.com with ESMTPS id yh7si14388668vdb.69.2014.07.03.09.33.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 03 Jul 2014 09:33:01 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) client-ip=209.85.128.179; Received: by mail-ve0-f179.google.com with SMTP id sa20so490641veb.38 for ; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) X-Received: by 10.221.64.80 with SMTP id xh16mr1721957vcb.35.1404405181745; Thu, 03 Jul 2014 09:33:01 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.37.5 with SMTP id tc5csp390836vcb; Thu, 3 Jul 2014 09:33:01 -0700 (PDT) X-Received: by 10.66.132.36 with SMTP id or4mr5852805pab.42.1404405180923; Thu, 03 Jul 2014 09:33:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ia5si33274287pbb.236.2014.07.03.09.33.00; Thu, 03 Jul 2014 09:33:00 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759047AbaGCQc7 (ORCPT + 13 others); Thu, 3 Jul 2014 12:32:59 -0400 Received: from service87.mimecast.com ([91.220.42.44]:44876 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758298AbaGCQ0J (ORCPT ); Thu, 3 Jul 2014 12:26:09 -0400 Received: from cam-owa2.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Thu, 03 Jul 2014 17:26:07 +0100 Received: from e103034-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa2.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Thu, 3 Jul 2014 17:26:07 +0100 From: Morten Rasmussen To: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, peterz@infradead.org, mingo@kernel.org Cc: rjw@rjwysocki.net, vincent.guittot@linaro.org, daniel.lezcano@linaro.org, preeti@linux.vnet.ibm.com, Dietmar.Eggemann@arm.com, pjt@google.com Subject: [RFCv2 PATCH 02/23] sched: Make energy awareness a sched feature Date: Thu, 3 Jul 2014 17:25:49 +0100 Message-Id: <1404404770-323-3-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1404404770-323-1-git-send-email-morten.rasmussen@arm.com> References: <1404404770-323-1-git-send-email-morten.rasmussen@arm.com> X-OriginalArrivalTime: 03 Jul 2014 16:26:07.0444 (UTC) FILETIME=[7E167940:01CF96DB] X-MC-Unique: 114070317260715001 Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: morten.rasmussen@arm.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.179 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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. Signed-off-by: Morten Rasmussen --- kernel/sched/fair.c | 5 +++++ kernel/sched/features.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d3c73122..981406e 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4215,6 +4215,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)