From patchwork Tue May 12 02:13:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 48315 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f70.google.com (mail-la0-f70.google.com [209.85.215.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 48D7521550 for ; Tue, 12 May 2015 02:15:07 +0000 (UTC) Received: by laat2 with SMTP id t2sf46190566laa.2 for ; Mon, 11 May 2015 19:15:06 -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; bh=3qVviJ5GygLrDi0HLeXm/ZT0mQpDfaOxZzB525ncSTE=; b=BmUKwo2ZZhzrPzMdr+eP1+D8Lv/hfFriq9w8vNZ2i44v4OuZ8a6/IqswCJSsMX+XRB oQDF8zGbmazi/vUl1mAIv7nxO/m9JEsgISdrGhUesicI1S4AM2hjWvr/sFVDyvAHwXMp I7t2EZzG/mt5OkZCbblmjgs13K9O5/OSUgHsoIIlECZTAQ2NY0xD8kCpZDbr2iqMdLq2 SVtmTs8PKiV11bBT7eStr72N00U3gxJvNdJrOhnZS9Vt2FpBMOyphR7xCYI5jyMHI8iw ec+kh4JpcfAKbwKr7Hl+vvemGO0LCqM5Xz2Rc657bTMfjQv8LfOxTA/rKoQph4d63Wxf LX7A== X-Gm-Message-State: ALoCoQkw4MO5oI83md98mRq65YgIR4wl8HiPq54c/U5Vd9VQA2n7ntVzg3lnoPH6TuruEmihNiRZ X-Received: by 10.112.160.197 with SMTP id xm5mr9122306lbb.15.1431396906062; Mon, 11 May 2015 19:15:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.182.228 with SMTP id eh4ls666409lac.45.gmail; Mon, 11 May 2015 19:15:05 -0700 (PDT) X-Received: by 10.112.154.138 with SMTP id vo10mr10199832lbb.68.1431396905894; Mon, 11 May 2015 19:15:05 -0700 (PDT) Received: from mail-lb0-f175.google.com (mail-lb0-f175.google.com. [209.85.217.175]) by mx.google.com with ESMTPS id yi7si9413434lbb.14.2015.05.11.19.15.05 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 19:15:05 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.175 as permitted sender) client-ip=209.85.217.175; Received: by lbbzk7 with SMTP id zk7so107192489lbb.0 for ; Mon, 11 May 2015 19:15:05 -0700 (PDT) X-Received: by 10.152.36.2 with SMTP id m2mr10024309laj.72.1431396905799; Mon, 11 May 2015 19:15:05 -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.112.108.230 with SMTP id hn6csp1816434lbb; Mon, 11 May 2015 19:15:04 -0700 (PDT) X-Received: by 10.70.61.68 with SMTP id n4mr24132001pdr.78.1431396903353; Mon, 11 May 2015 19:15:03 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zq5si13924292pbc.109.2015.05.11.19.15.02; Mon, 11 May 2015 19:15:03 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S932148AbbELCOo (ORCPT + 28 others); Mon, 11 May 2015 22:14:44 -0400 Received: from mail-ie0-f180.google.com ([209.85.223.180]:33381 "EHLO mail-ie0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752658AbbELCOe (ORCPT ); Mon, 11 May 2015 22:14:34 -0400 Received: by iepj10 with SMTP id j10so121278190iep.0 for ; Mon, 11 May 2015 19:14:34 -0700 (PDT) X-Received: by 10.107.32.73 with SMTP id g70mr227268iog.23.1431396874080; Mon, 11 May 2015 19:14: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 i191sm7408793ioe.0.2015.05.11.19.14.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 19:14:32 -0700 (PDT) From: Michael Turquette To: peterz@infradead.org, mingo@kernel.org Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, daniel.lezcano@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, abelvesa@gmail.com, Michael Turquette Subject: [PATCH RFC v2 2/4] sched: sched feature for cpu frequency selection Date: Mon, 11 May 2015 19:13:13 -0700 Message-Id: <1431396795-32439-3-git-send-email-mturquette@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1431396795-32439-1-git-send-email-mturquette@linaro.org> References: <1431396795-32439-1-git-send-email-mturquette@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.175 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 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 --- Changes in v2: none 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)