From patchwork Tue Dec 2 14:06:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Morten Rasmussen X-Patchwork-Id: 5420351 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B1D3BBEEA8 for ; Tue, 2 Dec 2014 14:08:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E330F2028D for ; Tue, 2 Dec 2014 14:08:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C02E220295 for ; Tue, 2 Dec 2014 14:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751599AbaLBOIk (ORCPT ); Tue, 2 Dec 2014 09:08:40 -0500 Received: from service87.mimecast.com ([91.220.42.44]:40201 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753915AbaLBOHE (ORCPT ); Tue, 2 Dec 2014 09:07:04 -0500 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.140]) by service87.mimecast.com; Tue, 02 Dec 2014 14:06:58 +0000 Received: from e105550-lin.cambridge.arm.com ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Dec 2014 14:06:58 +0000 From: Morten Rasmussen To: peterz@infradead.org, mingo@redhat.com Cc: dietmar.eggemann@arm.com, vincent.guittot@linaro.org, pjt@google.com, bsegall@google.com, mturquette@linaro.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Subject: [RFC PATCH 07/10] sched: Get rid of scaling usage by cpu_capacity_orig Date: Tue, 2 Dec 2014 14:06:29 +0000 Message-Id: <1417529192-11579-8-git-send-email-morten.rasmussen@arm.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1417529192-11579-1-git-send-email-morten.rasmussen@arm.com> References: <1417529192-11579-1-git-send-email-morten.rasmussen@arm.com> X-OriginalArrivalTime: 02 Dec 2014 14:06:58.0322 (UTC) FILETIME=[3C698F20:01D00E39] X-MC-Unique: 114120214065823601 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 From: Dietmar Eggemann Since now we have besides frequency invariant also cpu (uarch plus max system frequency) invariant cfs_rq::utilization_load_avg both, frequency and cpu scaling happens as part of the load tracking. So cfs_rq::utilization_load_avg does not have to be scaled by the original capacity of the cpu again. Cc: Ingo Molnar Cc: Peter Zijlstra Signed-off-by: Dietmar Eggemann --- kernel/sched/fair.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 5c4c989..090223f 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4806,12 +4806,11 @@ static int select_idle_sibling(struct task_struct *p, int target) static int get_cpu_usage(int cpu) { unsigned long usage = cpu_rq(cpu)->cfs.utilization_load_avg; - unsigned long capacity = capacity_orig_of(cpu); if (usage >= SCHED_LOAD_SCALE) - return capacity; + return capacity_orig_of(cpu); - return (usage * capacity) >> SCHED_LOAD_SHIFT; + return usage; } /*