From patchwork Wed May 14 20:57:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas Pitre X-Patchwork-Id: 30205 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ie0-f198.google.com (mail-ie0-f198.google.com [209.85.223.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id CF7E62055D for ; Wed, 14 May 2014 21:02:00 +0000 (UTC) Received: by mail-ie0-f198.google.com with SMTP id rp18sf694028iec.1 for ; Wed, 14 May 2014 14:02: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: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=gtDi1sqpjGprolq82oxzBfB6c8eaEQN/W1uHIjdyQls=; b=SyfhYc+iovOly/kc13BiJEl7ABineX6FpxmB6lKMOhcPveWxeVLJcgd+UA2IkG4oaP 5UT6Ge8nMrsnBgpA3TR3bjo5ZADcaqE5+lRo2NiVdmrgCArxI3bd+GMOO0i8rfeE8BTh 4ZM5OnqdEzOVGEbCEktZv1Nizj4RlAycRa8h7BaTuD0jvk+UTbEsDeezKtzL7aVOc4L2 Esdo/5vr6YRy1km8WxgW0REt6fmLVT9b7mJTHXG4KTQQueA40dXXDP0FEW7TMpAo2KFR eIghobhu+IWaq3Lt1q2ODM0zSBsrvNKrCt3I+fpzO97dLSNh0cSUBv2tD1aqz4yEwBwH o1bQ== X-Gm-Message-State: ALoCoQktwP/C5vao4OrQUUTKe89tVLgotbMJYXKC9DXc808EwssXI3ZcrTpeP+/LN8HIiM+PCd5F X-Received: by 10.43.141.196 with SMTP id jf4mr2688159icc.9.1400101320312; Wed, 14 May 2014 14:02:00 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.85.40 with SMTP id m37ls2611206qgd.18.gmail; Wed, 14 May 2014 14:02:00 -0700 (PDT) X-Received: by 10.52.120.39 with SMTP id kz7mr2741707vdb.41.1400101320228; Wed, 14 May 2014 14:02:00 -0700 (PDT) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by mx.google.com with ESMTPS id k2si530850vcr.120.2014.05.14.14.02.00 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 14 May 2014 14:02:00 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.178 as permitted sender) client-ip=209.85.220.178; Received: by mail-vc0-f178.google.com with SMTP id hq16so3232368vcb.37 for ; Wed, 14 May 2014 14:02:00 -0700 (PDT) X-Received: by 10.52.228.134 with SMTP id si6mr3955561vdc.5.1400101320118; Wed, 14 May 2014 14:02: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.220.221.72 with SMTP id ib8csp271140vcb; Wed, 14 May 2014 14:01:59 -0700 (PDT) X-Received: by 10.66.148.197 with SMTP id tu5mr7334066pab.108.1400101319290; Wed, 14 May 2014 14:01:59 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uv11si3093508pab.15.2014.05.14.14.01.58; Wed, 14 May 2014 14:01:58 -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 S1753298AbaENVBv (ORCPT + 27 others); Wed, 14 May 2014 17:01:51 -0400 Received: from relais.videotron.ca ([24.201.245.36]:62660 "EHLO relais.videotron.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752128AbaENU7y (ORCPT ); Wed, 14 May 2014 16:59:54 -0400 Received: from yoda.home ([66.130.143.177]) by VL-VM-MR002.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0N5L00I950ZTZF00@VL-VM-MR002.ip.videotron.ca> for linux-kernel@vger.kernel.org; Wed, 14 May 2014 16:59:53 -0400 (EDT) Received: from xanadu.home (xanadu.home [192.168.2.2]) by yoda.home (Postfix) with ESMTP id 334382DA0713; Wed, 14 May 2014 16:59:53 -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 1/6] sched/fair.c: remove "power" from struct numa_stats Date: Wed, 14 May 2014 16:57:05 -0400 Message-id: <1400101030-17717-2-git-send-email-nicolas.pitre@linaro.org> X-Mailer: git-send-email 1.8.4.108.g55ea5f6 In-reply-to: <1400101030-17717-1-git-send-email-nicolas.pitre@linaro.org> References: <1400101030-17717-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.178 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 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 28ccf502c6..e375dcc3f2 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 {