From patchwork Fri May 23 15:52:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 30822 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pb0-f69.google.com (mail-pb0-f69.google.com [209.85.160.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E523120369 for ; Fri, 23 May 2014 15:54:26 +0000 (UTC) Received: by mail-pb0-f69.google.com with SMTP id uo5sf18933284pbc.0 for ; Fri, 23 May 2014 08:54:26 -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=Np/twFT22ceMzAhq4Qk8uxje5O8ZpKYx1NC6YYUOaxw=; b=A2H9iQhune1I3O6UMadtTX+giZoONMtqzYKoEdaDs3YceLYOrWJo4CGWZeyVcN/MEV PMO+RdmEbo4yjtlRt0dLEzGMgQwB3FacSOW4H2U+GgbkuLu1yYv4ETU09XbS3WETKI44 4Hg4IjebjNjIIKLSxw2sPh4Sv/YqUnah0lbIwIe8X5UZGj5DL9PRja5TFgWQSSl5VlHR J9jGJuRLtQmPETrMMnfuewH+Dk7HVhZf6hrWiva6tGkj6YKzG1d094EOUycjbPTk9LGh 95XNh1QZejCueDz4Ip0YugIptjyIdK7BRRcl/0vnaafTCw5faXg8svpYAVHGBcOxVq9f UFzQ== X-Gm-Message-State: ALoCoQmCsX+qkxgxR/QvHSB7x5ml0WJhU6Qs3d1qzOp2UNeOq0xeqWkCfUyROe0J91iZH6jxQLaE X-Received: by 10.66.189.234 with SMTP id gl10mr2441162pac.20.1400860466215; Fri, 23 May 2014 08:54:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.94.145 with SMTP id g17ls1836794qge.76.gmail; Fri, 23 May 2014 08:54:26 -0700 (PDT) X-Received: by 10.220.105.4 with SMTP id r4mr4993137vco.27.1400860466032; Fri, 23 May 2014 08:54:26 -0700 (PDT) Received: from mail-ve0-f176.google.com (mail-ve0-f176.google.com [209.85.128.176]) by mx.google.com with ESMTPS id bo9si1868177vcb.86.2014.05.23.08.54.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:54:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.176 as permitted sender) client-ip=209.85.128.176; Received: by mail-ve0-f176.google.com with SMTP id jz11so6405829veb.7 for ; Fri, 23 May 2014 08:54:26 -0700 (PDT) X-Received: by 10.58.245.2 with SMTP id xk2mr4974844vec.9.1400860465959; Fri, 23 May 2014 08:54:25 -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 ib8csp42689vcb; Fri, 23 May 2014 08:54:25 -0700 (PDT) X-Received: by 10.66.141.144 with SMTP id ro16mr6895151pab.131.1400860464788; Fri, 23 May 2014 08:54:24 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rq2si4406078pbc.163.2014.05.23.08.54.24; Fri, 23 May 2014 08:54:24 -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 S1752981AbaEWPyQ (ORCPT + 27 others); Fri, 23 May 2014 11:54:16 -0400 Received: from mail-wi0-f174.google.com ([209.85.212.174]:45852 "EHLO mail-wi0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbaEWPyL (ORCPT ); Fri, 23 May 2014 11:54:11 -0400 Received: by mail-wi0-f174.google.com with SMTP id r20so1078175wiv.7 for ; Fri, 23 May 2014 08:54:10 -0700 (PDT) X-Received: by 10.194.5.5 with SMTP id o5mr5224511wjo.16.1400860450529; Fri, 23 May 2014 08:54:10 -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.08 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:54:09 -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 03/11] sched: fix avg_load computation Date: Fri, 23 May 2014 17:52:57 +0200 Message-Id: <1400860385-14555-4-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.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: , The computation of avg_load and avg_load_per_task should only takes into account the number of cfs tasks. The non cfs task are already taken into account by decreasing the cpu's capacity (cpu_power) and they will be tracked in the CPU's utilization (group_activity) of the next patches Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 30240ab..6a84114 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4048,7 +4048,7 @@ static unsigned long power_of(int cpu) static unsigned long cpu_avg_load_per_task(int cpu) { struct rq *rq = cpu_rq(cpu); - unsigned long nr_running = ACCESS_ONCE(rq->nr_running); + unsigned long nr_running = ACCESS_ONCE(rq->cfs.h_nr_running); unsigned long load_avg = rq->cfs.runnable_load_avg; if (nr_running) @@ -5868,7 +5868,7 @@ static inline void update_sg_lb_stats(struct lb_env *env, load = source_load(i, load_idx); sgs->group_load += load; - sgs->sum_nr_running += rq->nr_running; + sgs->sum_nr_running += rq->cfs.h_nr_running; #ifdef CONFIG_NUMA_BALANCING sgs->nr_numa_running += rq->nr_numa_running; sgs->nr_preferred_running += rq->nr_preferred_running;