From patchwork Mon Jul 28 17:51:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 34395 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pd0-f200.google.com (mail-pd0-f200.google.com [209.85.192.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id D6E92202E4 for ; Mon, 28 Jul 2014 17:54:08 +0000 (UTC) Received: by mail-pd0-f200.google.com with SMTP id w10sf50403883pde.3 for ; Mon, 28 Jul 2014 10:54:08 -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:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=sinm3tw2zoXsbsIVu3gGuSh2I9aL0Z8Iwr+Xg6MI8Aw=; b=AbeGcolv+g8xqFNSBZRXg7FMs94wQOa6Zv+ad4W6LiPYGuia9Kep4TW60yS5mX2tbT nhaWtLZGZ57fcsnoD+FocDhpufC8blQmgTmO2rz0XCWY33cW5agDYiytnz21LcGSyk0h zFc7V58EyZQSkWETmZcf/GMls5Mt3GEI3TEHNm1Cj1TzrPfzDTWlPOj4ODE738Gu6Pgl UFDK6bA0w6IztWzwC2x1PBnvHCW0ivby7Hl2XvbOgFigPzyQ2Iv99X0cTI4RvjAsF7Ww b9urbUARfl72DaQRUh2FOtS9m4nDYJTP8TJMQlkULpGuRToETwF9F6QOP7GQ3vQMcU58 soWg== X-Gm-Message-State: ALoCoQmnYYzEQxuKQSMRcTyQst8x1jWWHJAoNqENE42HbUI3BMVybahWaWkPZ9j9dLAuxQ4Xm22+ X-Received: by 10.70.98.164 with SMTP id ej4mr13903541pdb.3.1406570048008; Mon, 28 Jul 2014 10:54:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.40 with SMTP id m37ls2193697qgd.18.gmail; Mon, 28 Jul 2014 10:54:07 -0700 (PDT) X-Received: by 10.220.69.68 with SMTP id y4mr2562325vci.21.1406570047867; Mon, 28 Jul 2014 10:54:07 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id q7si1383544vcz.47.2014.07.28.10.54.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 10:54:07 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so11779492vcb.35 for ; Mon, 28 Jul 2014 10:54:07 -0700 (PDT) X-Received: by 10.221.34.13 with SMTP id sq13mr10385009vcb.16.1406570047747; Mon, 28 Jul 2014 10:54:07 -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.37.5 with SMTP id tc5csp185946vcb; Mon, 28 Jul 2014 10:54:05 -0700 (PDT) X-Received: by 10.70.102.66 with SMTP id fm2mr40373506pdb.102.1406570044495; Mon, 28 Jul 2014 10:54:04 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qc2si9288155pdb.307.2014.07.28.10.53.34 for ; Mon, 28 Jul 2014 10:54:04 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751745AbaG1Rw7 (ORCPT + 26 others); Mon, 28 Jul 2014 13:52:59 -0400 Received: from mail-we0-f175.google.com ([74.125.82.175]:39013 "EHLO mail-we0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751580AbaG1Rwu (ORCPT ); Mon, 28 Jul 2014 13:52:50 -0400 Received: by mail-we0-f175.google.com with SMTP id t60so7791000wes.34 for ; Mon, 28 Jul 2014 10:52:46 -0700 (PDT) X-Received: by 10.195.18.8 with SMTP id gi8mr50312689wjd.75.1406569966670; Mon, 28 Jul 2014 10:52:46 -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 ex4sm33758149wic.2.2014.07.28.10.52.44 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 28 Jul 2014 10:52:46 -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 Cc: riel@redhat.com, Morten.Rasmussen@arm.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, dietmar.eggemann@arm.com, Vincent Guittot Subject: [PATCH 06/12] sched: add per rq cpu_capacity_orig Date: Mon, 28 Jul 2014 19:51:40 +0200 Message-Id: <1406569906-9763-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1406569906-9763-1-git-send-email-vincent.guittot@linaro.org> References: <1406569906-9763-1-git-send-email-vincent.guittot@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.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.176 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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 --- 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 e1a2f31..fc5a275 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6976,7 +6976,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 00ff5f3..f6258bc 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5693,6 +5693,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 0191ed5..5a8ef50 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -571,6 +571,7 @@ struct rq { struct sched_domain *sd; unsigned long cpu_capacity; + unsigned long cpu_capacity_orig; unsigned char idle_balance; /* For active balancing */