From patchwork Mon May 4 22:10:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 48006 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f70.google.com (mail-wg0-f70.google.com [74.125.82.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 11D932121F for ; Mon, 4 May 2015 22:11:40 +0000 (UTC) Received: by wgin8 with SMTP id n8sf48007830wgi.0 for ; Mon, 04 May 2015 15:11:39 -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=KXkCrYXtGt7e00hsp0aZYg3VOK3Bq6IGe9vR3BUHhCc=; b=Gteohsz+oOGYv5E9fMTHc7AlXUaoFT5pjMb+ZZSJ2G396uN1R9rHDNmDYhRGzJ/sYZ Pe05Jf9PAVWTTP1hGkFQ5jNcAu8ccG6IF79bqAsxnvyJ7V/sU7m74INWiFUW0W8eoZx9 wWKOE3/GM3HOYRfQP4Ar5gJPjietyju80vJpeuDFWk+Qzq7qMLLjqbW1IQt8wTBrw0hs EbgIYkhm1m6q1yvSNyFsYDUt4CjO70AtQkgVyjNKdv7GD7TS8mZJyUeeU55MGOYXyymD dAzSu9B1xlx3riVopl6Fwxdeo+n8JTqwFxRr1dK2ICBqtqKKUFxrXSOQAefEu2tCLMVp LrRw== X-Gm-Message-State: ALoCoQnz8UXbdWdeZcvfhZfcgaPyyk3EIyQu1p8G4Pk5tFs1v9ltu9g0l0E0sQ2Zu7kA4Uuml/7s X-Received: by 10.112.171.41 with SMTP id ar9mr19981797lbc.24.1430777496807; Mon, 04 May 2015 15:11:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.231 with SMTP id i7ls741841lae.85.gmail; Mon, 04 May 2015 15:11:36 -0700 (PDT) X-Received: by 10.152.45.9 with SMTP id i9mr21008827lam.87.1430777496666; Mon, 04 May 2015 15:11:36 -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 ev1si10978634lbc.0.2015.05.04.15.11.36 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 15:11:36 -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 lbbzk7 with SMTP id zk7so115276823lbb.0 for ; Mon, 04 May 2015 15:11:36 -0700 (PDT) X-Received: by 10.153.8.167 with SMTP id dl7mr21373835lad.86.1430777496543; Mon, 04 May 2015 15:11:36 -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.67.65 with SMTP id l1csp1903938lbt; Mon, 4 May 2015 15:11:35 -0700 (PDT) X-Received: by 10.107.8.7 with SMTP id 7mr25273741ioi.87.1430777495104; Mon, 04 May 2015 15:11:35 -0700 (PDT) Received: from mail-ig0-f173.google.com (mail-ig0-f173.google.com. [209.85.213.173]) by mx.google.com with ESMTPS id r2si5982074igp.24.2015.05.04.15.11.34 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 May 2015 15:11:35 -0700 (PDT) Received-SPF: pass (google.com: domain of mturquette@linaro.org designates 209.85.213.173 as permitted sender) client-ip=209.85.213.173; Received: by igbpi8 with SMTP id pi8so75162556igb.0 for ; Mon, 04 May 2015 15:11:34 -0700 (PDT) X-Received: by 10.43.116.196 with SMTP id fj4mr30243356icc.38.1430777494343; Mon, 04 May 2015 15:11:34 -0700 (PDT) Received: from quantum.home (pool-71-119-96-202.lsanca.fios.verizon.net. [71.119.96.202]) by mx.google.com with ESMTPSA id ij7sm6042583igb.18.2015.05.04.15.11.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 04 May 2015 15:11:33 -0700 (PDT) From: Michael Turquette To: peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, inaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, patches@linaro.org, eas-dev@lists.linaro.org, dietmar.eggemann@arm.com, vincent.guittot@linaro.org, amit.kucheria@linaro.org, juri.lelli@arm.com, rjw@rjwysocki.net, viresh.kumar@linaro.org, ashwin.chaugule@linaro.org, alex.shi@linaro.org, Michael Turquette Subject: [PATCH 2/4] sched: sched feature for cpu frequency selection Date: Mon, 4 May 2015 15:10:39 -0700 Message-Id: <1430777441-15087-3-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1430777441-15087-1-git-send-email-mturquette@linaro.org> References: <1430777441-15087-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: , This patch introduces the SCHED_ENERGY_FREQ sched feature, which is implemented using jump labels when SCHED_DEBUG is defined. It is statically set to false when SCHED_DEBUG is not defined and thus disabled by default. Signed-off-by: Michael Turquette --- 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 46855d0..75aec8d 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4207,6 +4207,11 @@ static inline void hrtick_update(struct rq *rq) } #endif +static inline bool sched_energy_freq(void) +{ + return sched_feat(SCHED_ENERGY_FREQ); +} + /* * 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 91e33cd..77381cf 100644 --- a/kernel/sched/features.h +++ b/kernel/sched/features.h @@ -96,3 +96,9 @@ SCHED_FEAT(NUMA_FAVOUR_HIGHER, true) */ SCHED_FEAT(NUMA_RESIST_LOWER, false) #endif + +/* + * Scheduler-driven CPU frequency selection aimed to save energy based on + * load tracking + */ +SCHED_FEAT(SCHED_ENERGY_FREQ, false)