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: 6385011 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 24F5A9F399 for ; Tue, 12 May 2015 02:15:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 58E58203B5 for ; Tue, 12 May 2015 02:15:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E74AE203AC for ; Tue, 12 May 2015 02:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932098AbbELCOh (ORCPT ); Mon, 11 May 2015 22:14:37 -0400 Received: from mail-ie0-f182.google.com ([209.85.223.182]:35126 "EHLO mail-ie0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752616AbbELCOe (ORCPT ); Mon, 11 May 2015 22:14:34 -0400 Received: by ieczm2 with SMTP id zm2so124633999iec.2 for ; Mon, 11 May 2015 19:14:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=l9FCjisDlBnA3TqtA6hD3WWTYxAg0btsLsoF/ilaQHM=; b=HJYGcnCOrUsSz8QA3H/im0Tz13obbsb7GbMgTxO0zj3ozVvCgfWET7MeKNkY+jmTAq EjKLmuapbUQJzQeA2DVyPDN7/lPghNBSqKpU7987t4SKkkZ5gOSpOMau7IxqEv7FOCjO n4/kf3kK77cbIxsILZXmJ5P53l7TR5GuDJD49k9TdmBpyp2MXHn71iDu8jWGQ/4UlXtm kbfyPf31CoPXVFq+wIOrYj11BDbYSE9o9W3kw5mJAyXiRb3QlXLhyHlpaFTWXUYwlqo6 OE5PKdz72Ud8g8easmhkMTcBLTKUQgmCOdlqtsYEguNtX+dSVHH+o7rJngri5Ce/Y9jT OO/g== X-Gm-Message-State: ALoCoQnNL0B7DkUgoPSWm2rcSlGK3ciHJ9soH4TuCRGEwvdDRwNTYNi9HO3xRZYDT6CrryL+znoD 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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)