From patchwork Tue May 12 02:13:14 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 48317 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BB79C21550 for ; Tue, 12 May 2015 02:15:22 +0000 (UTC) Received: by wiz9 with SMTP id 9sf14625662wiz.3 for ; Mon, 11 May 2015 19:15:22 -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=psyjgbI2CvIkQOQ+TDbQcgg1g2P3slp24oLGeJjrwWE=; b=h3jwOrIC6qCxN6jt9UU2aTf1UIoDi8hn4XVjU/O9URkCppe4RK9+HlS9hcn/HxTIEz IbpXpDBegVNPv+0L/jCbL9Be+fhMytGXLxonEcIlc7lUM0gy+aSzY7XCt5/xZgMNhjaq VWdPhlByNilcAhUn+HLoRBi+hjV+0FA39U5ozb3Rum0w/SmAkRDGc5l/Q4xdwzp/X9Ic cb4Q55bWCgdjtFGu2MY/wvbcq3RmSImeLah+nFoJSQuxQ/rejuCEkDL/v4fupOJR+oJU CxDxBiB+Q9O51W5LTHEowsKWmQZUNR45/LpC6TCk9cpGB9vHEOGfNIJxO+gLcGIv9vD8 zkrA== X-Gm-Message-State: ALoCoQnI2Eu1CKPLZs0obq2VZ5nK8qj6SSj8q4kV+DywIOvea4sgjvqgbwa52WhNcFl78Ue30Xjr X-Received: by 10.180.105.67 with SMTP id gk3mr863802wib.4.1431396922034; Mon, 11 May 2015 19:15:22 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.121.98 with SMTP id lj2ls675200lab.94.gmail; Mon, 11 May 2015 19:15:21 -0700 (PDT) X-Received: by 10.153.7.104 with SMTP id db8mr10355917lad.124.1431396921883; Mon, 11 May 2015 19:15:21 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com. [209.85.215.50]) by mx.google.com with ESMTPS id k5si9385039lbp.148.2015.05.11.19.15.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2015 19:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by layy10 with SMTP id y10so106362245lay.0 for ; Mon, 11 May 2015 19:15:21 -0700 (PDT) X-Received: by 10.113.10.134 with SMTP id ea6mr10046437lbd.29.1431396921759; Mon, 11 May 2015 19:15:21 -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 hn6csp1816530lbb; Mon, 11 May 2015 19:15:20 -0700 (PDT) X-Received: by 10.68.169.34 with SMTP id ab2mr23590685pbc.120.1431396919612; Mon, 11 May 2015 19:15:19 -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.18; Mon, 11 May 2015 19:15:19 -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 S1752086AbbELCPR (ORCPT + 11 others); Mon, 11 May 2015 22:15:17 -0400 Received: from mail-ie0-f177.google.com ([209.85.223.177]:33415 "EHLO mail-ie0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932086AbbELCOh (ORCPT ); Mon, 11 May 2015 22:14:37 -0400 Received: by iepj10 with SMTP id j10so121278981iep.0 for ; Mon, 11 May 2015 19:14:37 -0700 (PDT) X-Received: by 10.50.8.68 with SMTP id p4mr716174iga.4.1431396877031; Mon, 11 May 2015 19:14:37 -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.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 May 2015 19:14:36 -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 3/4] sched: expose capacity_of in sched.h Date: Mon, 11 May 2015 19:13:14 -0700 Message-Id: <1431396795-32439-4-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: list List-ID: X-Mailing-List: linux-pm@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.215.50 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: , capacity_of is of use to a cpu frequency scaling policy based on cfs load tracking and cpu capacity utilization metrics. Expose this call in sched.h so it can be used in such a policy. Signed-off-by: Michael Turquette --- Changes in v2: Do not expose get_cpu_usage or capacity_orig_of in sched.h Expose capacity_of instead kernel/sched/fair.c | 5 ----- kernel/sched/sched.h | 5 +++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 75aec8d..d27ded9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4361,11 +4361,6 @@ static unsigned long target_load(int cpu, int type) return max(rq->cpu_load[type-1], total); } -static unsigned long capacity_of(int cpu) -{ - return cpu_rq(cpu)->cpu_capacity; -} - static unsigned long capacity_orig_of(int cpu) { return cpu_rq(cpu)->cpu_capacity_orig; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index e0e1299..4925bc4 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1396,6 +1396,11 @@ unsigned long arch_scale_freq_capacity(struct sched_domain *sd, int cpu) } #endif +static inline unsigned long capacity_of(int cpu) +{ + return cpu_rq(cpu)->cpu_capacity; +} + static inline void sched_rt_avg_update(struct rq *rq, u64 rt_delta) { rq->rt_avg += rt_delta * arch_scale_freq_capacity(NULL, cpu_of(rq));