From patchwork Tue Aug 26 11:06:46 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 35983 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oi0-f70.google.com (mail-oi0-f70.google.com [209.85.218.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 562A920551 for ; Tue, 26 Aug 2014 11:08:24 +0000 (UTC) Received: by mail-oi0-f70.google.com with SMTP id u20sf75109153oif.1 for ; Tue, 26 Aug 2014 04:08:23 -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=gbBzkpfrYCjQBorpEJmdDPdF0Nh65jO/N4hA6//iE3g=; b=iGS9uCDwDHGBGwHIS44TP2lcUcjgw1vWAwPE/3KhSBZvWYJDV4LeSla2dW/3NcbREu 3clmyEVslIT4r6JMbjKbXQqTbDMpnSpdO8y+jiDyvqp5/Kp5zmKUNf0aOA8uXK5Es+q8 kXQNAafJM8SENlYfH3TrXRnhN4ZrTy7I8b143qcngp47eFj0sQX6sDv2pRsKyS2jTHnH US1VudT/RN1iIDOMtCZx+6CBHKRFI3E5AbfeL247fcNup/9jlcEi/19v73oqaIQsTI+F cYizadHKZIZ+siADhGjHb1vY22nfN5fq5FqifVO/ttZ0uHczHEQFZCcnN1Ub9F/svcai 5ayg== X-Gm-Message-State: ALoCoQmDzs7VRFbLf2zutMX3LYRJ737qi0ubYpuBWEReax1MT6WDLhN5aLw1k4b06eBWWUH3SklI X-Received: by 10.50.136.194 with SMTP id qc2mr13777773igb.7.1409051303941; Tue, 26 Aug 2014 04:08:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.105.247 with SMTP id c110ls1976807qgf.5.gmail; Tue, 26 Aug 2014 04:08:23 -0700 (PDT) X-Received: by 10.52.106.198 with SMTP id gw6mr19436389vdb.23.1409051303782; Tue, 26 Aug 2014 04:08:23 -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 ck3si1202022vcb.102.2014.08.26.04.08.23 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 04:08:23 -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 la4so16536530vcb.19 for ; Tue, 26 Aug 2014 04:08:23 -0700 (PDT) X-Received: by 10.52.162.74 with SMTP id xy10mr8876150vdb.51.1409051303675; Tue, 26 Aug 2014 04:08:23 -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.45.67 with SMTP id uj3csp189080vcb; Tue, 26 Aug 2014 04:08:23 -0700 (PDT) X-Received: by 10.68.161.197 with SMTP id xu5mr12405978pbb.160.1409051302759; Tue, 26 Aug 2014 04:08:22 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id oy3si3949283pdb.50.2014.08.26.04.08.20 for ; Tue, 26 Aug 2014 04:08:22 -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 S1757625AbaHZLHx (ORCPT + 26 others); Tue, 26 Aug 2014 07:07:53 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:40340 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757599AbaHZLHu (ORCPT ); Tue, 26 Aug 2014 07:07:50 -0400 Received: by mail-wg0-f44.google.com with SMTP id m15so14296660wgh.27 for ; Tue, 26 Aug 2014 04:07:49 -0700 (PDT) X-Received: by 10.180.92.134 with SMTP id cm6mr21637047wib.72.1409051269435; Tue, 26 Aug 2014 04:07: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 q6sm2494891wjy.47.2014.08.26.04.07.47 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 26 Aug 2014 04:07:48 -0700 (PDT) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org Cc: riel@redhat.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 v5 03/12] sched: fix avg_load computation Date: Tue, 26 Aug 2014 13:06:46 +0200 Message-Id: <1409051215-16788-4-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1409051215-16788-1-git-send-email-vincent.guittot@linaro.org> References: <1409051215-16788-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.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: , 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 and they will be tracked in the CPU's utilization (group_utilization) of the next patches Signed-off-by: Vincent Guittot Reviewed-by: Preeti U Murthy --- 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 87b9dc7..b85e9f7 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4092,7 +4092,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) @@ -5985,7 +5985,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; if (rq->nr_running > 1) *overload = true;