From patchwork Wed Oct 22 06:07:25 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 39247 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2CCD4202DB for ; Wed, 22 Oct 2014 06:07:56 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf208133wib.1 for ; Tue, 21 Oct 2014 23:07:55 -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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=jOLTImFRoQeBS6JqWaTrChEOAccOk3DDeeCd8gA7I/U=; b=ahEVm/TbiJyITE5AnHEfoWO+nhmnasxr7Wwtfl/MwYnyC4jsGINetdDmbCw1gW1Pv5 A5gM1ruYxFdpabFNKfCB0b7e9ppxaJOFTSsUMzWRNfoFkBm7CMup67qH35MoWgvJvSjy D/JkMFqnuhPg7jGyFuOtjdWJRpYybg+QQ0xcYS+NGaDuDmKfNq89I8Rc3hwOZCqHl/cB P5mFnzWzF2H8DEE7/pk+04ll0IHBX7Fvw0Fysrvy68hSoI6j7kJk9Sc72yn/Eiq4jynC +kwOo0oFlsvEwZ2+7Cim/EBcKJWotk/5+s/aUhY3wzc5z6Ns69RXIuE0tUTjLjc9YBgM ghJw== X-Gm-Message-State: ALoCoQl8MgNGAexoLEcXa2Fq3fJ1S2G/uBnvU9HwyD/ZWdNUL/d+qD+LZHgoxMGSm2BxDNL1Urux X-Received: by 10.112.254.226 with SMTP id al2mr6106221lbd.1.1413958074726; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.1 with SMTP id s1ls153662lal.30.gmail; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) X-Received: by 10.152.28.134 with SMTP id b6mr40432850lah.12.1413958074590; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id pt7si21913550lbb.120.2014.10.21.23.07.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:54 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id u10so2276570lbd.1 for ; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) X-Received: by 10.112.12.35 with SMTP id v3mr21249693lbb.80.1413958074063; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.84.229 with SMTP id c5csp17710lbz; Tue, 21 Oct 2014 23:07:53 -0700 (PDT) X-Received: by 10.70.38.109 with SMTP id f13mr16061265pdk.132.1413958072643; Tue, 21 Oct 2014 23:07:52 -0700 (PDT) Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com. [209.85.220.47]) by mx.google.com with ESMTPS id bw3si13267138pab.190.2014.10.21.23.07.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:52 -0700 (PDT) Received-SPF: pass (google.com: domain of mturquette@linaro.org designates 209.85.220.47 as permitted sender) client-ip=209.85.220.47; Received: by mail-pa0-f47.google.com with SMTP id kq14so2998532pab.6 for ; Tue, 21 Oct 2014 23:07:52 -0700 (PDT) X-Received: by 10.66.170.46 with SMTP id aj14mr40617213pac.68.1413958071926; Tue, 21 Oct 2014 23:07:51 -0700 (PDT) Received: from quantum.home (pool-108-47-66-231.lsanca.fios.verizon.net. [108.47.66.231]) by mx.google.com with ESMTPSA id t1sm3836068pda.59.2014.10.21.23.07.49 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:50 -0700 (PDT) From: Mike Turquette To: peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, kamalesh@linux.vnet.ibm.com, riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, dietmar.eggemann@arm.com, pjt@google.com, bsegall@google.com, vincent.guittot@linaro.org, patches@linaro.org, tuukka.tikkanen@linaro.org, amit.kucheria@linaro.org, Morten Rasmussen , Mike Turquette Subject: [PATCH RFC 1/7] sched: Make energy awareness a sched feature Date: Tue, 21 Oct 2014 23:07:25 -0700 Message-Id: <1413958051-7103-2-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1413958051-7103-1-git-send-email-mturquette@linaro.org> References: <1413958051-7103-1-git-send-email-mturquette@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: mturquette@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Morten Rasmussen 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 Signed-off-by: Mike Turquette [mturquette@linaro.org: moved energy_aware above enqueue_task_fair] --- 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 6738160..90b36cc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -3978,6 +3978,11 @@ static inline void hrtick_update(struct rq *rq) } #endif +static inline bool energy_aware(void) +{ + return sched_feat(ENERGY_AWARE); +} + /* * The enqueue_task method is called before nr_running is * increased. Here we update the fair scheduling stats and 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)