From patchwork Mon Jun 30 16:05:34 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 32773 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4FFE8203C0 for ; Mon, 30 Jun 2014 16:07:03 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id f51sf5410575qge.6 for ; Mon, 30 Jun 2014 09:07:03 -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=dRYl4HZPHm0YGarC3QxECS3TYk4MK6X5ZEu5KWT8ZkA=; b=bmEbWb8AzP5YLkwbib9i38uPEl189z9/6rvwLltgzFBdE0Fgzz6eQgFQJNEiznR9ZO tdQW0Ils1dSa0RwcFTZGUAhSaQvLfKHp+jtrPWXqQIyE8w0TU8cas498Fo/Lt2fmJaQ3 VpGCtHrRzp0y89QbBvKBU++4ZP86kHgT22bAPL81nZoYwwosiSTiJpGfTVoIILptBjMg nXXtMrB8Vm6XreXGU4O6MFW3MMZYPfmT3ddc3EARdPgQU/UUSEtzGDvlmqaNmqpsd76G 8DSbLS5obY6FKmFdHPCIXCfzLbPvMGn8E8ixHPHNAbyTnho3FqaIJwfZFnQTJ8G136TX svyA== X-Gm-Message-State: ALoCoQlpZOqd/u9QRynDBe6mpdIc9wWxBhj2K5iFHZSyWP0CAtu5xjVd22r2+0YlpLnxfFaWJGkz X-Received: by 10.236.35.5 with SMTP id t5mr964524yha.9.1404144423169; Mon, 30 Jun 2014 09:07:03 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.131 with SMTP id b3ls1479433qge.29.gmail; Mon, 30 Jun 2014 09:07:03 -0700 (PDT) X-Received: by 10.58.234.199 with SMTP id ug7mr1753839vec.40.1404144423058; Mon, 30 Jun 2014 09:07:03 -0700 (PDT) Received: from mail-ve0-f170.google.com (mail-ve0-f170.google.com [209.85.128.170]) by mx.google.com with ESMTPS id uk3si10229021vec.102.2014.06.30.09.07.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 09:07:03 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.170 as permitted sender) client-ip=209.85.128.170; Received: by mail-ve0-f170.google.com with SMTP id i13so8360291veh.15 for ; Mon, 30 Jun 2014 09:07:03 -0700 (PDT) X-Received: by 10.52.23.71 with SMTP id k7mr32760882vdf.27.1404144422985; Mon, 30 Jun 2014 09:07:02 -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 tc5csp151215vcb; Mon, 30 Jun 2014 09:07:02 -0700 (PDT) X-Received: by 10.68.181.67 with SMTP id du3mr53124131pbc.96.1404144422400; Mon, 30 Jun 2014 09:07:02 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ef2si23660456pbb.106.2014.06.30.09.07.01; Mon, 30 Jun 2014 09:07:01 -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 S1756427AbaF3QGz (ORCPT + 27 others); Mon, 30 Jun 2014 12:06:55 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:57086 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754530AbaF3QGu (ORCPT ); Mon, 30 Jun 2014 12:06:50 -0400 Received: by mail-wi0-f181.google.com with SMTP id n3so6289095wiv.2 for ; Mon, 30 Jun 2014 09:06:49 -0700 (PDT) X-Received: by 10.180.76.68 with SMTP id i4mr30449528wiw.83.1404144409177; Mon, 30 Jun 2014 09:06:49 -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 lo18sm32896271wic.1.2014.06.30.09.06.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 09:06:48 -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, dietmar.eggemann@arm.com, Vincent Guittot Subject: [PATCH v3 03/12] sched: fix avg_load computation Date: Mon, 30 Jun 2014 18:05:34 +0200 Message-Id: <1404144343-18720-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404144343-18720-1-git-send-email-vincent.guittot@linaro.org> References: <1404144343-18720-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.170 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_utilization) of the next patches Signed-off-by: Vincent Guittot Acked-by: Rik van Riel --- 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 c6dba48..148b277 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4051,7 +4051,7 @@ static unsigned long capacity_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) @@ -5865,7 +5865,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;