From patchwork Tue Aug 26 11:06:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 4780401 Return-Path: X-Original-To: patchwork-linux-arm@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 7647EC0338 for ; Tue, 26 Aug 2014 11:10:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E3EB201DC for ; Tue, 26 Aug 2014 11:10:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 392C020158 for ; Tue, 26 Aug 2014 11:10:33 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMEcW-0003Fx-8q; Tue, 26 Aug 2014 11:09:00 +0000 Received: from mail-we0-f173.google.com ([74.125.82.173]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMEbp-0002e6-1K for linux-arm-kernel@lists.infradead.org; Tue, 26 Aug 2014 11:08:17 +0000 Received: by mail-we0-f173.google.com with SMTP id q58so14596059wes.4 for ; Tue, 26 Aug 2014 04:07:54 -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=cphCq8c5cIjjzW8a5/GXXysJZC6yjaN8zi/iCaKcPnM=; b=PPcFwJmuWXxIgjTlnO2MvA6JPrvS8PIVHaQEZ6ogaLjWyKIGD1VIr2lYn5gyp8APHT s0GbKkcfVqTYReO/RSPp+rild7bcccs71vSGbNh5OVy88vaPiTOm7Gwa4yFkX+F4rPZ/ C0r7HgFTgHLOjBSMSbH6x/4sOSKnPyGnz99zodWohp3fsoE2J6T/RPHwUDEk/1o1rqk/ W12wS0CF5tLm2hLEnOcu+XGezUyCC/D33oRP18v0at5JIxsx2qx+AwaxRB5TnlEvr//s fed5FYLENOjw0+WzmK93jrXGmt1NnC9CdDhU3LrriGfQf3ixiXCFsYtllztaQVV+c1Ed LzqA== X-Gm-Message-State: ALoCoQkx7DIl0t6VfwKU+VytLO+b6pBhUS2yKTWuwBNTYKWpGjGHQx3HU3Zo4yUipdzYNAq6Ed5Y X-Received: by 10.180.92.104 with SMTP id cl8mr20893233wib.43.1409051274790; Tue, 26 Aug 2014 04:07:54 -0700 (PDT) Received: from lmenx30s.lme.st.com (LPuteaux-656-01-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id q6sm2494891wjy.47.2014.08.26.04.07.53 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 04:07:53 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Subject: [PATCH v5 06/12] sched: add per rq cpu_capacity_orig Date: Tue, 26 Aug 2014 13:06:49 +0200 Message-Id: <1409051215-16788-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409051215-16788-1-git-send-email-vincent.guittot@linaro.org> References: <1409051215-16788-1-git-send-email-vincent.guittot@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140826_040817_219393_ABD22BE1 X-CRM114-Status: GOOD ( 12.19 ) X-Spam-Score: -0.7 (/) Cc: nicolas.pitre@linaro.org, riel@redhat.com, daniel.lezcano@linaro.org, Vincent Guittot , efault@gmx.de, dietmar.eggemann@arm.com, linaro-kernel@lists.linaro.org, Morten.Rasmussen@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 new field cpu_capacity_orig reflects the available capacity of a CPUs unlike the cpu_capacity which reflects the current capacity that can be altered by frequency and rt tasks. Signed-off-by: Vincent Guittot Reviewed-by: Kamalesh Babulal --- kernel/sched/core.c | 2 +- kernel/sched/fair.c | 1 + kernel/sched/sched.h | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index a394f99..7c3b237 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -7003,7 +7003,7 @@ void __init sched_init(void) #ifdef CONFIG_SMP rq->sd = NULL; rq->rd = NULL; - rq->cpu_capacity = SCHED_CAPACITY_SCALE; + rq->cpu_capacity = rq->cpu_capacity_orig = SCHED_CAPACITY_SCALE; rq->post_schedule = 0; rq->active_balance = 0; rq->next_balance = jiffies; diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 8176bda..17c16cc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5756,6 +5756,7 @@ static void update_cpu_capacity(struct sched_domain *sd, int cpu) capacity >>= SCHED_CAPACITY_SHIFT; + cpu_rq(cpu)->cpu_capacity_orig = capacity; sdg->sgc->capacity_orig = capacity; if (sched_feat(ARCH_CAPACITY)) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index aa0f73b..7c0a74e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -575,6 +575,7 @@ struct rq { struct sched_domain *sd; unsigned long cpu_capacity; + unsigned long cpu_capacity_orig; unsigned char idle_balance; /* For active balancing */