From patchwork Tue Oct 7 12:13: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: 38400 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f71.google.com (mail-wg0-f71.google.com [74.125.82.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 87870202E7 for ; Tue, 7 Oct 2014 12:16:50 +0000 (UTC) Received: by mail-wg0-f71.google.com with SMTP id y10sf3965102wgg.6 for ; Tue, 07 Oct 2014 05:16:49 -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=Nmpr/S6EyHcoV2M1genAR5Naui9lhxPXUwu6ODT8Ig8=; b=JyhYdY8mR0w92qvYxPzpb3218YJssSTsksUjhDsT+PeB5E58nKvkvruKLbflInIYYe Cc3D2TXl3mdrdUQl0HgdFX7ul3YKJ8yKzPNZQf7HrfmvajpkwhTA8LCsLdmwY4DCV89X snTvDywNZe02mCsiAeK65Kn3zQ5FXk9bZjJUysvJhPi3DiomBQKqNYSwJc2YvDTUoN1Y MJj3XJY4rhFrqsWzgE6nJbJs/k+xqk5BHD3KPLHnaf0KYuCv06n6n6ZggpeLFVkNtv+Y qDmd1r3cmY32MAH0j7IGISLNOiCzDheriyCuCfun/GOavLJxaH01WR1KYXnLMifsF1ki YijA== X-Gm-Message-State: ALoCoQkI7IipjfoJPiBeqisa/59Bu7bPy7HrnD7Sg/KkQ8htrDsXhJmNvBdst7HHAxfwYZ4SgdN1 X-Received: by 10.112.140.199 with SMTP id ri7mr11264lbb.17.1412684209707; Tue, 07 Oct 2014 05:16:49 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.133 with SMTP id o5ls124286lal.35.gmail; Tue, 07 Oct 2014 05:16:49 -0700 (PDT) X-Received: by 10.152.5.40 with SMTP id p8mr3826825lap.32.1412684209498; Tue, 07 Oct 2014 05:16:49 -0700 (PDT) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com [209.85.217.180]) by mx.google.com with ESMTPS id u14si28482728laz.45.2014.10.07.05.16.49 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 05:16:49 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id f15so5927253lbj.39 for ; Tue, 07 Oct 2014 05:16:49 -0700 (PDT) X-Received: by 10.112.164.71 with SMTP id yo7mr3603451lbb.73.1412684209414; Tue, 07 Oct 2014 05:16:49 -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.112.130.169 with SMTP id of9csp339067lbb; Tue, 7 Oct 2014 05:16:48 -0700 (PDT) X-Received: by 10.66.152.41 with SMTP id uv9mr3256956pab.25.1412684207712; Tue, 07 Oct 2014 05:16:47 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id td1si15585020pbc.140.2014.10.07.05.16.46 for ; Tue, 07 Oct 2014 05:16:47 -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 S1753969AbaJGMQo (ORCPT + 27 others); Tue, 7 Oct 2014 08:16:44 -0400 Received: from mail-wg0-f43.google.com ([74.125.82.43]:45519 "EHLO mail-wg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753676AbaJGMPQ (ORCPT ); Tue, 7 Oct 2014 08:15:16 -0400 Received: by mail-wg0-f43.google.com with SMTP id m15so9006886wgh.2 for ; Tue, 07 Oct 2014 05:15:15 -0700 (PDT) X-Received: by 10.194.62.166 with SMTP id z6mr4328489wjr.44.1412684115260; Tue, 07 Oct 2014 05:15:15 -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 v9sm20544897wjy.14.2014.10.07.05.15.13 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 07 Oct 2014 05:15:14 -0700 (PDT) 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.linux.org.uk, linux-arm-kernel@lists.infradead.org Cc: riel@redhat.com, efault@gmx.de, nicolas.pitre@linaro.org, linaro-kernel@lists.linaro.org, daniel.lezcano@linaro.org, dietmar.eggemann@arm.com, pjt@google.com, bsegall@google.com, Morten Rasmussen Subject: [PATCH 4/7] sched: Track group sched_entity usage contributions Date: Tue, 7 Oct 2014 14:13:34 +0200 Message-Id: <1412684017-16595-5-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412684017-16595-1-git-send-email-vincent.guittot@linaro.org> References: <1412684017-16595-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.180 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 --- kernel/sched/debug.c | 3 +++ kernel/sched/fair.c | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index e0fbc0f..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 @@ -633,6 +635,7 @@ void proc_sched_show_task(struct task_struct *p, struct seq_file *m) 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 P(policy); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index d6de526..d3e9067 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2381,6 +2381,8 @@ static inline u64 __synchronize_entity_decay(struct sched_entity *se) return 0; se->avg.load_avg_contrib = decay_load(se->avg.load_avg_contrib, decays); + se->avg.utilization_avg_contrib = + decay_load(se->avg.utilization_avg_contrib, decays); se->avg.decay_count = 0; return decays; @@ -2525,6 +2527,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; }