From patchwork Wed Oct 22 06:07:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Turquette X-Patchwork-Id: 39249 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f198.google.com (mail-wi0-f198.google.com [209.85.212.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D78BB202DB for ; Wed, 22 Oct 2014 06:07:59 +0000 (UTC) Received: by mail-wi0-f198.google.com with SMTP id hi2sf208606wib.5 for ; Tue, 21 Oct 2014 23:07:59 -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=gnQO4KdRL8ZKwzvVpb888i2xJbprAlTGlfEd7SqAbYY=; b=O5L5PgjsWZUI6sc0s3b4G+CBpWlasZDjaykOu6xV4hXINeICPeszJ+U7flH4VtDk2u YaQsz/NzXSnE/Gd/RL6ulYPGZCHkcXzOvXP8zQrXpqUBrW/thhRVyVl5Omlek8Gqsh2i v4iEJ9fKwJlAkfuXH3VIe15Dw+rPbGa2/HrmVCzm+rg0FyLZQ9P1nKhBdudLN2U7H5fM s4n1hGSglulbKhwpur2IGwjleCPtuUJ13t+aPSUGERtbw0HMuyQ8kp/wgzP09JPt+il2 B44FCwvhOiBPGRJQXVvQP6apyquY2d3z4Be4tCzlkTtr9avvpMFCEdLIW+oRJui1x8QN w/kQ== X-Gm-Message-State: ALoCoQneiXPcwnUXfY+j4tNX7wefcRlouwszvgYinAaYqfYNLUcUSX0McoGu4rLqhhlhk20j7RPG X-Received: by 10.112.138.202 with SMTP id qs10mr6026838lbb.5.1413958079024; Tue, 21 Oct 2014 23:07:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.21.135 with SMTP id v7ls156228lae.40.gmail; Tue, 21 Oct 2014 23:07:58 -0700 (PDT) X-Received: by 10.112.41.168 with SMTP id g8mr38814139lbl.59.1413958078888; Tue, 21 Oct 2014 23:07:58 -0700 (PDT) Received: from mail-la0-f49.google.com (mail-la0-f49.google.com. [209.85.215.49]) by mx.google.com with ESMTPS id am6si21908496lac.124.2014.10.21.23.07.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:58 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.49 as permitted sender) client-ip=209.85.215.49; Received: by mail-la0-f49.google.com with SMTP id q1so2282326lam.36 for ; Tue, 21 Oct 2014 23:07:58 -0700 (PDT) X-Received: by 10.112.130.41 with SMTP id ob9mr38730246lbb.74.1413958078792; Tue, 21 Oct 2014 23:07:58 -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 c5csp17721lbz; Tue, 21 Oct 2014 23:07:58 -0700 (PDT) X-Received: by 10.66.218.168 with SMTP id ph8mr39969222pac.51.1413958077301; Tue, 21 Oct 2014 23:07:57 -0700 (PDT) Received: from mail-pa0-f53.google.com (mail-pa0-f53.google.com. [209.85.220.53]) by mx.google.com with ESMTPS id s3si11087871pda.246.2014.10.21.23.07.56 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 mturquette@linaro.org designates 209.85.220.53 as permitted sender) client-ip=209.85.220.53; Received: by mail-pa0-f53.google.com with SMTP id kq14so2969948pab.26 for ; Tue, 21 Oct 2014 23:07:56 -0700 (PDT) X-Received: by 10.68.165.1 with SMTP id yu1mr39862548pbb.76.1413958076599; Tue, 21 Oct 2014 23:07:56 -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.54 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 21 Oct 2014 23:07:55 -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 3/7] sched: fair: add usage_util_of helper Date: Tue, 21 Oct 2014 23:07:27 -0700 Message-Id: <1413958051-7103-4-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.49 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: , Signed-off-by: Mike Turquette --- kernel/sched/fair.c | 6 ++++++ kernel/sched/sched.h | 1 + 2 files changed, 7 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 15f5638..0930ad8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2057,6 +2057,7 @@ static inline void account_numa_dequeue(struct rq *rq, struct task_struct *p) #ifdef CONFIG_SMP unsigned long capacity_of(int cpu); +unsigned long usage_util_of(int cpu); #endif /* CONFIG_SMP */ static void @@ -4140,6 +4141,11 @@ unsigned long capacity_of(int cpu) return cpu_rq(cpu)->cpu_capacity; } +unsigned long usage_util_of(int cpu) +{ + return cpu_rq(cpu)->cfs.usage_util_avg; +} + static unsigned long cpu_avg_load_per_task(int cpu) { struct rq *rq = cpu_rq(cpu); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 9a28d38..c34cbfc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -310,6 +310,7 @@ struct cfs_bandwidth { }; #endif /* CONFIG_CGROUP_SCHED */ extern unsigned long capacity_of(int cpu); +extern unsigned long usage_util_of(int cpu); /* CFS-related fields in a runqueue */ struct cfs_rq {