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: 4234141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6745ABF90B for ; Fri, 23 May 2014 15:58:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A0910203AC for ; Fri, 23 May 2014 15:58:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C223C203AA for ; Fri, 23 May 2014 15:58:15 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wnrop-0007FN-26; Fri, 23 May 2014 15:55:39 +0000 Received: from mail-we0-f179.google.com ([74.125.82.179]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Wnrnn-0005o1-9W for linux-arm-kernel@lists.infradead.org; Fri, 23 May 2014 15:54:36 +0000 Received: by mail-we0-f179.google.com with SMTP id q59so4958937wes.24 for ; Fri, 23 May 2014 08:54:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=aTYDQwT5Pn3WzxWXYNgLZFX5RjhYftluc2aaqioMYxU=; b=g+B5bwlTVJEOcntbyLJIOV1b+SMngb4EGhIrcyQlcDVZ++e3Epr3KK4CRlxevHG5Ho 0o8pG/Wjc+9lPMPHDbtQ13Ow8DSaRRHUuDVw9xoWP4KyPChLFVBU4lycTTEd25DAqsKc 2HTwHPyf0jJf/5v1GocKLLGtGi74Yb2aHr2iRGw8FuW1Fx1mx9xZ7DgMhz8MJnOgFMYX 5CUlNW45xF4tb520sRZFxf1IZQB2ihf4A1OW4k/+6ia0zlLD1F2HMJtBqBotgab9lq4b t5LBhfGTJVytdVXHeWM2Dg2AWiai88vGNP1nMPlziklpGKGJIVhP7qx+RNy4aeiUIklU uEAQ== X-Gm-Message-State: ALoCoQkbCN1v7BmFa8i9EMzuLnEXQisqkMs3EOAaFHGPRXaBRmCtlwBMRGoSKlpBSK/Ibj8CrFve 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140523_085435_518236_6FBA1CBC X-CRM114-Status: GOOD ( 12.16 ) X-Spam-Score: -0.7 (/) Cc: nicolas.pitre@linaro.org, efault@gmx.de, Vincent Guittot , daniel.lezcano@linaro.org, linaro-kernel@lists.linaro.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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;