From patchwork Mon May 26 22:19:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 30945 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f198.google.com (mail-ig0-f198.google.com [209.85.213.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 082EE20A25 for ; Mon, 26 May 2014 22:20:47 +0000 (UTC) Received: by mail-ig0-f198.google.com with SMTP id uq10sf1322685igb.5 for ; Mon, 26 May 2014 15:20:47 -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 :content-transfer-encoding; bh=8plioF+bEdHvBmwL0BuT1UHmKb7vpwBdAWGrtiG6maU=; b=GAHUNyxKlLqN/YMamRW+jHKtRX2qwB1EpekOLO9NnWCxKAP/RUfxzY5N76R9kfH854 b4ks1exmE6mLHfX/nXeTIpMGUOA4+wsnch2uAxswn5/KoP8uPMo1RywXNUXlexoIQcdW iiNEKNVG4MoFdkH5Ve3fNA1S6fm9/IdARcXPs2TxUlqNFoHdrPu4jJp/igQv7Na73fhO PmVzKHmb+9jL89t0vSXGOjVh2PmYVQWbQAPxdtoAUezoazbyQw7b1506GD8GyWTTpq2y peEpCFuUq+qKfI4PJNHcV2n2Z2fB4Roj1bR8KFH2ncVQc/RCHrCzpFidepGUcOAb/Eng DUBA== X-Gm-Message-State: ALoCoQmFh6jyKU4QGRFmP4cg5u1oXYVtBeVMWZPRyzKkKPRRwyTheJqMc8fORYNq5cYsp0rYPtI3 X-Received: by 10.182.97.165 with SMTP id eb5mr11754633obb.43.1401142847298; Mon, 26 May 2014 15:20:47 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.23.7 with SMTP id 7ls2938582qgo.60.gmail; Mon, 26 May 2014 15:20:47 -0700 (PDT) X-Received: by 10.53.13.35 with SMTP id ev3mr19363372vdd.1.1401142847195; Mon, 26 May 2014 15:20:47 -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 hy3si7026599vdb.52.2014.05.26.15.20.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 26 May 2014 15:20:47 -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 hq11so3988983vcb.19 for ; Mon, 26 May 2014 15:20:47 -0700 (PDT) X-Received: by 10.52.14.9 with SMTP id l9mr8019403vdc.41.1401142847115; Mon, 26 May 2014 15:20:47 -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 ib8csp72963vcb; Mon, 26 May 2014 15:20:46 -0700 (PDT) X-Received: by 10.68.133.229 with SMTP id pf5mr31778910pbb.115.1401142846290; Mon, 26 May 2014 15:20:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sm10si16418084pab.134.2014.05.26.15.20.45 for ; Mon, 26 May 2014 15:20:45 -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 S1753268AbaEZWTs (ORCPT + 27 others); Mon, 26 May 2014 18:19:48 -0400 Received: from relais.videotron.ca ([24.201.245.36]:61825 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbaEZWTp (ORCPT ); Mon, 26 May 2014 18:19:45 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR006.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N67003U8COV7GC0@VL-VM-MR006.ip.videotron.ca> for linux-kernel@vger.kernel.org; Mon, 26 May 2014 18:19:43 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 77A792DA077D; Mon, 26 May 2014 18:19:43 -0400 (EDT) From: Nicolas Pitre To: Peter Zijlstra , Ingo Molnar Cc: Vincent Guittot , Daniel Lezcano , Morten Rasmussen , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, linaro-kernel@lists.linaro.org Subject: [PATCH v2 1/6] sched/fair.c: remove "power" from struct numa_stats Date: Mon, 26 May 2014 18:19:34 -0400 Message-id: <1401142779-6633-2-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1401142779-6633-1-git-send-email-nicolas.pitre@linaro.org> References: <1401142779-6633-1-git-send-email-nicolas.pitre@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: nicolas.pitre@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 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Content-transfer-encoding: 7BIT It is better not to think about compute capacity as being equivalent to "CPU power". The upcoming "power aware" scheduler work may create confusion with the notion of energy consumption if "power" is used too liberally. To make things explicit and not create more confusion with the existing "capacity" member, let's rename things as follows: power -> compute_capacity capacity -> task_capacity Note: none of those fields are actually used outside update_numa_stats(). Signed-off-by: Nicolas Pitre --- kernel/sched/fair.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index c9617b73bc..16f0dddb70 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1026,10 +1026,10 @@ struct numa_stats { unsigned long load; /* Total compute capacity of CPUs on a node */ - unsigned long power; + unsigned long compute_capacity; /* Approximate capacity in terms of runnable tasks on a node */ - unsigned long capacity; + unsigned long task_capacity; int has_capacity; }; @@ -1046,7 +1046,7 @@ static void update_numa_stats(struct numa_stats *ns, int nid) ns->nr_running += rq->nr_running; ns->load += weighted_cpuload(cpu); - ns->power += power_of(cpu); + ns->compute_capacity += power_of(cpu); cpus++; } @@ -1062,9 +1062,10 @@ static void update_numa_stats(struct numa_stats *ns, int nid) if (!cpus) return; - ns->load = (ns->load * SCHED_POWER_SCALE) / ns->power; - ns->capacity = DIV_ROUND_CLOSEST(ns->power, SCHED_POWER_SCALE); - ns->has_capacity = (ns->nr_running < ns->capacity); + ns->load = (ns->load * SCHED_POWER_SCALE) / ns->compute_capacity; + ns->task_capacity = + DIV_ROUND_CLOSEST(ns->compute_capacity, SCHED_POWER_SCALE); + ns->has_capacity = (ns->nr_running < ns->task_capacity); } struct task_numa_env {