From patchwork Fri May 23 15:53:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 30829 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5B8DE20369 for ; Fri, 23 May 2014 15:56:18 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lj1sf18812058pab.1 for ; Fri, 23 May 2014 08:56:17 -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=ROEHcHvp9x/u+OCjEL6aXh8ADD4R+YGWQuDk/j5K+A4=; b=PO0IMbiy/mMTlZjVhk+AnFgnJZ1BA0/8wtJHxoL2a50cnGDxMcytytSlZ36V6BBWr5 3DoKgmpmMtXb1JOHgn+UxdOXdIhmRXWn7FYC7uPKksAN3JCRoNfd8PNNSaYJtu7rOLjV GjkB4AGr8u0C+hEpWL/c30b1lWTn7WJXZDJ0zdpOOtUpsmxlgVJYQpxeFEUvePHoMNeh BhQ7dtXFVHiVy9mPIWh0gmzQ4CZ+v3Iyo2eAisP8NQfOA9EyCAuwoYZbZSI3ReXAFBYD lueOt5iZpLYlCm7/y7uLcXKOoQo46DyXlSOSZQtqPz6rcvOXOpOBWoQG3MvSkZ7OumZK fswA== X-Gm-Message-State: ALoCoQlFXTQmHCcjnB69Duc4khexdyNLkBK4jll723EyabzL/JgV1I19KPfrLj5NMpDnT40znpWK X-Received: by 10.67.30.197 with SMTP id kg5mr2542100pad.36.1400860577550; Fri, 23 May 2014 08:56:17 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.234 with SMTP id a97ls1761597qgf.51.gmail; Fri, 23 May 2014 08:56:17 -0700 (PDT) X-Received: by 10.58.23.6 with SMTP id i6mr5106305vef.12.1400860577395; Fri, 23 May 2014 08:56:17 -0700 (PDT) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id qy9si1875283vcb.69.2014.05.23.08.56.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:56:17 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.182 as permitted sender) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id sa20so6617553veb.27 for ; Fri, 23 May 2014 08:56:17 -0700 (PDT) X-Received: by 10.220.7.131 with SMTP id d3mr1312044vcd.45.1400860577320; Fri, 23 May 2014 08:56:17 -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.220.221.72 with SMTP id ib8csp42859vcb; Fri, 23 May 2014 08:56:16 -0700 (PDT) X-Received: by 10.66.159.34 with SMTP id wz2mr7046820pab.96.1400860576558; Fri, 23 May 2014 08:56:16 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ko1si4441431pbc.100.2014.05.23.08.56.16 for ; Fri, 23 May 2014 08:56:16 -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 S1753471AbaEWP4H (ORCPT + 27 others); Fri, 23 May 2014 11:56:07 -0400 Received: from mail-wg0-f47.google.com ([74.125.82.47]:54539 "EHLO mail-wg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbaEWPyR (ORCPT ); Fri, 23 May 2014 11:54:17 -0400 Received: by mail-wg0-f47.google.com with SMTP id x12so5037774wgg.30 for ; Fri, 23 May 2014 08:54:15 -0700 (PDT) X-Received: by 10.194.174.168 with SMTP id bt8mr3066786wjc.72.1400860455812; Fri, 23 May 2014 08:54:15 -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 m1sm3558594wib.20.2014.05.23.08.54.14 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:54:14 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Cc: preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, Vincent Guittot Subject: [PATCH v2 06/11] sched: add per rq cpu_power_orig Date: Fri, 23 May 2014 17:53:00 +0200 Message-Id: <1400860385-14555-7-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1400860385-14555-1-git-send-email-vincent.guittot@linaro.org> References: <1400860385-14555-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.128.182 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_power_orig reflects the available capacity of a CPUs unlike the cpu_power 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 240aa83..686c56f 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6946,7 +6946,7 @@ void __init sched_init(void) #ifdef CONFIG_SMP rq->sd = NULL; rq->rd = NULL; - rq->cpu_power = SCHED_POWER_SCALE; + rq->cpu_power = rq->cpu_power_orig = SCHED_POWER_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 6dc05f7..b3dc2b3 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5675,6 +5675,7 @@ static void update_cpu_power(struct sched_domain *sd, int cpu) power >>= SCHED_POWER_SHIFT; + cpu_rq(cpu)->cpu_power_orig = power; sdg->sgp->power_orig = power; if (sched_feat(ARCH_POWER)) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 600e229..4c74014 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -568,6 +568,7 @@ struct rq { struct sched_domain *sd; unsigned long cpu_power; + unsigned long cpu_power_orig; unsigned char idle_balance; /* For active balancing */