From patchwork Thu Jan 15 10:09:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 43156 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 77E65240BA for ; Thu, 15 Jan 2015 10:12:42 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf7451222lbv.1 for ; Thu, 15 Jan 2015 02:12:41 -0800 (PST) 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=SfCVQInXmzwWdZZJUGYBrCr90L1hd6E8C948orKEMcw=; b=KvQ+xG2F5vEfgeemdlxsBK9Rqq0zApB3va0OgwYtP5vyZg8kjEjSgqyEEPnP84Mj9o B4jH5nypKhp9YJhCk5w17XJp4i7zDJV6ygHOvGkT3+zRtGtUwrO3MWtDuc5Utl3ONBVe juquyxhmfYSjHLkCezfW00RGbfOyF8l4Rn3mpIswRZyzsIoXs/sYeZbAWNDmp5JVQZyT 94nSKWu4jW/uUBAdttSaxaZeaJJY6R2aZXiSfx7KGj7bZ2e4w960/FE2nisizwGjWON1 WHYb0iiKIBEXna9Yss+lsZMKwVpkPhEanXgPcSe1d6bJxs2KCjTXQDBUGi7KTXv5qrwl sSSQ== X-Gm-Message-State: ALoCoQnNxCujqVQPEKFG33TYCqAlIyHxF9YJs73liSrD+UheYRo+34tQGZx6VqF83dFtH/PhiCQv X-Received: by 10.152.2.40 with SMTP id 8mr152832lar.7.1421316761391; Thu, 15 Jan 2015 02:12:41 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.161.198 with SMTP id xu6ls197433lab.86.gmail; Thu, 15 Jan 2015 02:12:41 -0800 (PST) X-Received: by 10.152.5.132 with SMTP id s4mr2794494las.39.1421316761218; Thu, 15 Jan 2015 02:12:41 -0800 (PST) Received: from mail-lb0-f171.google.com (mail-lb0-f171.google.com. [209.85.217.171]) by mx.google.com with ESMTPS id m4si939082laa.107.2015.01.15.02.12.41 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 02:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.171 as permitted sender) client-ip=209.85.217.171; Received: by mail-lb0-f171.google.com with SMTP id w7so12463221lbi.2 for ; Thu, 15 Jan 2015 02:12:41 -0800 (PST) X-Received: by 10.152.18.135 with SMTP id w7mr8533496lad.47.1421316761119; Thu, 15 Jan 2015 02:12:41 -0800 (PST) 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.112.9.200 with SMTP id c8csp1981231lbb; Thu, 15 Jan 2015 02:12:40 -0800 (PST) X-Received: by 10.68.202.98 with SMTP id kh2mr13305736pbc.6.1421316759000; Thu, 15 Jan 2015 02:12:39 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id jv6si1398076pbc.29.2015.01.15.02.12.38; Thu, 15 Jan 2015 02:12:38 -0800 (PST) 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 S1752862AbbAOKMd (ORCPT + 28 others); Thu, 15 Jan 2015 05:12:33 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:39750 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752766AbbAOKM2 (ORCPT ); Thu, 15 Jan 2015 05:12:28 -0500 Received: by mail-wg0-f54.google.com with SMTP id z12so13899238wgg.13 for ; Thu, 15 Jan 2015 02:12:27 -0800 (PST) X-Received: by 10.194.184.140 with SMTP id eu12mr16043671wjc.25.1421316747409; Thu, 15 Jan 2015 02:12:27 -0800 (PST) Received: from lmenx30s.lme.st.com (LPuteaux-656-1-48-212.w82-127.abo.wanadoo.fr. [82.127.83.212]) by mx.google.com with ESMTPSA id fi10sm15113674wib.13.2015.01.15.02.12.23 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 15 Jan 2015 02:12:26 -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 Cc: riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, dietmar.eggemann@arm.com, linaro-kernel@lists.linaro.org, Morten Rasmussen , Paul Turner , Ben Segall , Vincent Guittot Subject: [PATCH RESEND v9 02/10] sched: Track group sched_entity usage contributions Date: Thu, 15 Jan 2015 11:09:22 +0100 Message-Id: <1421316570-23097-3-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1421316570-23097-1-git-send-email-vincent.guittot@linaro.org> References: <1421316570-23097-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.217.171 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: , 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; }