From patchwork Wed Oct 22 06:07:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 39248 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 79686202DB for ; Wed, 22 Oct 2014 06:07:58 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf1625319lbv.8 for ; Tue, 21 Oct 2014 23:07:57 -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=uvuYG0TZIp0QHUsMT3ZGPVUTyEr/pM0uuzO4utP1qqk=; b=IiZyep2ILQpyeORo+/v3eYee7VccpSv/j+R9jC8mT/X9HOkGgrylFn/GyVTIUZBwFX UBKGz3TO+hfAwvScWxgeBDtU7XfFaOrPXmrbtAKGlMkgVB2Cbw5FvhC9HycrpkM+5K4l XN/g5c4rHswewn17oamOBDCdBu3zi1aPJgowQkg03bghAAaoe5jQp5cVAcKv5LYW3vNK 3OuOwIVbM1o0mSpdJKsAxPJ+gxk7sIpOlQ9qjwAY5M85fMSkIApJr2QrNtBjc1zoMawA mBoM9+wcE5O1N8YiOgYB4YNWukAfyWPO1r7WbrWqW6MOTnJyPHLpliv5/sM7QEO4cA8y jQaQ== X-Gm-Message-State: ALoCoQmlU/derLm+gcfpHWuFB2PWflxkaMtHo5G6IeYXDKpMt5nC/aKtrhjU8ep+8h8jtUAzZcGo X-Received: by 10.112.97.35 with SMTP id dx3mr12882lbb.20.1413958077373; Tue, 21 Oct 2014 23:07:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.169 with SMTP id r9ls125927laj.57.gmail; Tue, 21 Oct 2014 23:07:57 -0700 (PDT) X-Received: by 10.112.134.39 with SMTP id ph7mr39493854lbb.45.1413958077240; Tue, 21 Oct 2014 23:07:57 -0700 (PDT) Received: from mail-la0-f47.google.com (mail-la0-f47.google.com. [209.85.215.47]) by mx.google.com with ESMTPS id z3si22005142lad.17.2014.10.21.23.07.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.47 as permitted sender) client-ip=209.85.215.47; Received: by mail-la0-f47.google.com with SMTP id pv20so2291120lab.20 for ; Tue, 21 Oct 2014 23:07:57 -0700 (PDT) X-Received: by 10.112.167.38 with SMTP id zl6mr39354315lbb.34.1413958077156; Tue, 21 Oct 2014 23:07:57 -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 c5csp17716lbz; Tue, 21 Oct 2014 23:07:56 -0700 (PDT) X-Received: by 10.66.243.3 with SMTP id wu3mr40222813pac.87.1413958075571; Tue, 21 Oct 2014 23:07:55 -0700 (PDT) Received: from mail-pd0-f169.google.com (mail-pd0-f169.google.com. [209.85.192.169]) by mx.google.com with ESMTPS id wl10si13204890pbc.211.2014.10.21.23.07.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:55 -0700 (PDT) Received-SPF: pass (google.com: domain of mturquette@linaro.org designates 209.85.192.169 as permitted sender) client-ip=209.85.192.169; Received: by mail-pd0-f169.google.com with SMTP id w10so2874722pde.14 for ; Tue, 21 Oct 2014 23:07:54 -0700 (PDT) X-Received: by 10.68.129.167 with SMTP id nx7mr40139728pbb.51.1413958074303; Tue, 21 Oct 2014 23:07:54 -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.52 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:53 -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, Mike Turquette Subject: [PATCH RFC 2/7] sched: cfs: declare capacity_of in sched.h Date: Tue, 21 Oct 2014 23:07:26 -0700 Message-Id: <1413958051-7103-3-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.215.47 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: , capacity_of is useful for cpu frequency scaling policies. Share it via sched.h so that selectable cpu frequency scaling policies can make use of it. Signed-off-by: Mike Turquette --- kernel/sched/fair.c | 7 +++++-- kernel/sched/sched.h | 2 ++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 90b36cc..15f5638 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1018,7 +1018,6 @@ bool should_numa_migrate_memory(struct task_struct *p, struct page * page, static unsigned long weighted_cpuload(const int cpu); static unsigned long source_load(int cpu, int type); static unsigned long target_load(int cpu, int type); -static unsigned long capacity_of(int cpu); static long effective_load(struct task_group *tg, int cpu, long wl, long wg); /* Cached statistics for all CPUs within a node */ @@ -2056,6 +2055,10 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p) } #endif /* CONFIG_NUMA_BALANCING */ +#ifdef CONFIG_SMP +unsigned long capacity_of(int cpu); +#endif /* CONFIG_SMP */ + static void account_entity_enqueue(struct cfs_rq *cfs_rq, struct sched_entity *se) { @@ -4132,7 +4135,7 @@ static unsigned long target_load(int cpu, int type) return max(rq->cpu_load[type-1], total); } -static unsigned long capacity_of(int cpu) +unsigned long capacity_of(int cpu) { return cpu_rq(cpu)->cpu_capacity; } diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 04940f8..9a28d38 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -309,6 +309,8 @@ struct cfs_bandwidth { }; #endif /* CONFIG_CGROUP_SCHED */ +extern unsigned long capacity_of(int cpu); + /* CFS-related fields in a runqueue */ struct cfs_rq { struct load_weight load;