From patchwork Mon Nov 3 16:54:39 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 5218351 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 981F69F349 for ; Mon, 3 Nov 2014 16:58:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B244A20136 for ; Mon, 3 Nov 2014 16:58:31 +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 CDA202012F for ; Mon, 3 Nov 2014 16:58:30 +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 1XlKvd-0002Nc-6m; Mon, 03 Nov 2014 16:56:29 +0000 Received: from mail-wi0-f171.google.com ([209.85.212.171]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XlKvY-0002G3-0V for linux-arm-kernel@lists.infradead.org; Mon, 03 Nov 2014 16:56:25 +0000 Received: by mail-wi0-f171.google.com with SMTP id q5so7058442wiv.10 for ; Mon, 03 Nov 2014 08:56:01 -0800 (PST) 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=PJGz+EDNjILA0WqDvdVlXQSny20Gssys4AZ28Hacv5I=; b=LLuXdL0hxVtX+r1NjqWZyH/BdT+V+q4gVpSdpsVFejHH+5Vno956qsgkoAau9WQAGz QYELelUsA8ys/WZh68xVLzuLFk9fxVqekWLIRCHVRJr8sAumfYUHFRkZKWe8JojXIrBy oMX3T9LoL4cJOoAdNtuHd17XUwTTjMagf1Mdpn3dwfHVDs6TAjsBXh0YBe29TdRYNpCZ e7irWszGnfaUopbOR/dOONMDRgDo144cDmY+sidZ3O+CNXJ7uhSbJwcBkj//s/d1BytB Doppte5IsHrHXcnn7qFp27GOiy+XKnDFNeoo4glPOwtJhEoRs26E5X7fDmyw3L0xZCbG 8c6w== X-Gm-Message-State: ALoCoQkh89g0Ms1/Pqv5tddbxR5yrMpqurl6oR26eDR0U4VpMQeM2aY87m9OoUMrVmwp1GRv7mk4 X-Received: by 10.180.206.14 with SMTP id lk14mr17599058wic.47.1415033761559; Mon, 03 Nov 2014 08:56:01 -0800 (PST) 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 s8sm22798078wjx.9.2014.11.03.08.55.59 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Nov 2014 08:56:00 -0800 (PST) From: Vincent Guittot To: peterz@infradead.org, mingo@kernel.org, linux-kernel@vger.kernel.org, preeti@linux.vnet.ibm.com, Morten.Rasmussen@arm.com, kamalesh@linux.vnet.ibm.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH v9 02/10] sched: Track group sched_entity usage contributions Date: Mon, 3 Nov 2014 17:54:39 +0100 Message-Id: <1415033687-23294-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415033687-23294-1-git-send-email-vincent.guittot@linaro.org> References: <1415033687-23294-1-git-send-email-vincent.guittot@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141103_085624_203710_E3D909D3 X-CRM114-Status: UNSURE ( 9.32 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: nicolas.pitre@linaro.org, riel@redhat.com, linaro-kernel@lists.linaro.org, Vincent Guittot , efault@gmx.de, Ben Segall , Paul Turner , Morten Rasmussen X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 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, RCVD_IN_DNSWL_NONE, 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 From: Morten Rasmussen Adds usage contribution tracking for group entities. Unlike se->avg.load_avg_contrib, se->avg.utilization_avg_contrib for group entities is the sum of se->avg.utilization_avg_contrib for all entities on the group runqueue. It is _not_ influenced in any way by the task group h_load. Hence it is representing the actual cpu usage of the group, not its intended load contribution which may differ significantly from the utilization on lightly utilized systems. cc: Paul Turner cc: Ben Segall Signed-off-by: Morten Rasmussen Signed-off-by: Vincent Guittot --- kernel/sched/debug.c | 2 ++ kernel/sched/fair.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index f384452..efb47ed 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -94,8 +94,10 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group P(se->load.weight); #ifdef CONFIG_SMP P(se->avg.runnable_avg_sum); + P(se->avg.running_avg_sum); P(se->avg.avg_period); P(se->avg.load_avg_contrib); + P(se->avg.utilization_avg_contrib); P(se->avg.decay_count); #endif #undef PN diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 3a91ae6..a171e1b 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2529,6 +2529,9 @@ static long __update_entity_utilization_avg_contrib(struct sched_entity *se) if (entity_is_task(se)) __update_task_entity_utilization(se); + else + se->avg.utilization_avg_contrib = + group_cfs_rq(se)->utilization_load_avg; return se->avg.utilization_avg_contrib - old_contrib; }