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: 35993 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CE81B20551 for ; Tue, 26 Aug 2014 11:10:00 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id b6sf50232572yha.5 for ; Tue, 26 Aug 2014 04:10:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=GR+rQmkkGT31wx6lXJm9uLQz9PdW/+0JBC9xK4DFKDw=; b=LjjInJU/Kro8vwex/Bmzzpw7DW9aNTnCKf8u1gcZH5rPRJA/CIE1GzqOLMaAS1nwVF R4jZ8fH+VlE18nHH63YDgvONvTlJSQWnKMVdNI8Ey0GfB7lMUKuofcEJk/3+obvAFR6e 7Mx0Y5I7VuLo/oEMjU15ik27IXfy98Q9CtHPGIBSc8R7BAU9RKWAm0V1zz/0ETXsoxGr oV1sRWK6m7sDtZUgfAxYbi96HUrGdcSxnXwgjxqzJcYRCmzJX/MDm+a3omovK5nKJVpa BIIx4d7kUmMaweN66bBLbeVVrnMxvlNCDvKIlg69wZbpiu1t17L+8VhSvlEL9+fd2W/x 6YLg== X-Gm-Message-State: ALoCoQnMYc6r2F9KI+fIxN/PUrVl1eVjckejJci+Ri1LHn1BxvB7GvVpeUM4QUXNgtEEa80v1IDq X-Received: by 10.52.190.163 with SMTP id gr3mr486151vdc.3.1409051400637; Tue, 26 Aug 2014 04:10:00 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.106.34 with SMTP id d31ls1650321qgf.93.gmail; Tue, 26 Aug 2014 04:10:00 -0700 (PDT) X-Received: by 10.221.64.142 with SMTP id xi14mr11362383vcb.31.1409051400557; Tue, 26 Aug 2014 04:10:00 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id bz3si1249059vcb.23.2014.08.26.04.10.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 04:10:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.174 as permitted sender) client-ip=209.85.220.174; Received: by mail-vc0-f174.google.com with SMTP id la4so16729589vcb.33 for ; Tue, 26 Aug 2014 04:10:00 -0700 (PDT) X-Received: by 10.221.68.66 with SMTP id xx2mr23401977vcb.1.1409051400473; Tue, 26 Aug 2014 04:10:00 -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.221.45.67 with SMTP id uj3csp189183vcb; Tue, 26 Aug 2014 04:09:59 -0700 (PDT) X-Received: by 10.68.224.40 with SMTP id qz8mr36700353pbc.9.1409051398941; Tue, 26 Aug 2014 04:09:58 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id hg4si3801660pbc.123.2014.08.26.04.09.58 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Aug 2014 04:09:58 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; 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-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 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.173 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.173 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders 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+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: vincent.guittot@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.220.174 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 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 */