From patchwork Mon Jun 30 16:05:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 32775 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f200.google.com (mail-ve0-f200.google.com [209.85.128.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3CADE21131 for ; Mon, 30 Jun 2014 16:07:27 +0000 (UTC) Received: by mail-ve0-f200.google.com with SMTP id i13sf19414932veh.7 for ; Mon, 30 Jun 2014 09:07:27 -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=swwa+/90x3pjH0TsUg+quXa9mCXiA7arsQm522aimZw=; b=BBpsg/TMk8CUAnHmy4TqLPjwJjqdT8KgFYdqaMJTWiGoRzooWNP3xvb5WfRplMWykI VqRsxDfBriYPNQiAHjVnyNeMvaevxRQfKwM6Nbi+w3bGaaoVK0U0bC544PhN+SVwvVcu FB/o4HmmsTRO4fC5xBVPPdXz2uMnJKZlgDMDDOBVPJfbgIaWLImUf1tReS5llPcpnII4 f71Ya+pNwbqBkEhXlTx49PyTiISPq3U6OKPgFA8ymNBr5vRSrrqufJzNIJYu9Jv83Hmp H9jbUCtSLB1Edw/IMFDeeTZ2bUyslLKzaaleQaJX1swWSGxwKxpgGenuAWBTmb6Lv9+F qV0A== X-Gm-Message-State: ALoCoQmRnbj3zt/CiEBZ+flcl67Rzg54AJ8eko9cOqOdzGEyEiQYwUcCeCtEw2lC1kEqyjlOYWMn X-Received: by 10.236.62.165 with SMTP id y25mr849452yhc.26.1404144447033; Mon, 30 Jun 2014 09:07:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.46.99 with SMTP id j90ls1546287qga.49.gmail; Mon, 30 Jun 2014 09:07:26 -0700 (PDT) X-Received: by 10.52.30.9 with SMTP id o9mr32643236vdh.15.1404144446894; Mon, 30 Jun 2014 09:07:26 -0700 (PDT) Received: from mail-ve0-f173.google.com (mail-ve0-f173.google.com [209.85.128.173]) by mx.google.com with ESMTPS id d7si4818533vcy.33.2014.06.30.09.07.26 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 09:07:26 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.173 as permitted sender) client-ip=209.85.128.173; Received: by mail-ve0-f173.google.com with SMTP id db11so8296519veb.4 for ; Mon, 30 Jun 2014 09:07:26 -0700 (PDT) X-Received: by 10.58.209.7 with SMTP id mi7mr690429vec.80.1404144446782; Mon, 30 Jun 2014 09:07:26 -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.37.5 with SMTP id tc5csp151242vcb; Mon, 30 Jun 2014 09:07:26 -0700 (PDT) X-Received: by 10.66.192.73 with SMTP id he9mr54004635pac.88.1404144446069; Mon, 30 Jun 2014 09:07:26 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id dm2si23671463pbb.68.2014.06.30.09.07.25; Mon, 30 Jun 2014 09:07:25 -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 S1756588AbaF3QHG (ORCPT + 27 others); Mon, 30 Jun 2014 12:07:06 -0400 Received: from mail-wi0-f173.google.com ([209.85.212.173]:51953 "EHLO mail-wi0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754530AbaF3QHB (ORCPT ); Mon, 30 Jun 2014 12:07:01 -0400 Received: by mail-wi0-f173.google.com with SMTP id cc10so6332675wib.12 for ; Mon, 30 Jun 2014 09:07:00 -0700 (PDT) X-Received: by 10.195.17.164 with SMTP id gf4mr45063868wjd.45.1404144420691; Mon, 30 Jun 2014 09:07:00 -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 lo18sm32896271wic.1.2014.06.30.09.06.58 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 09:06:59 -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 Cc: preeti@linux.vnet.ibm.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 v3 09/12] Revert "sched: Put rq's sched_avg under CONFIG_FAIR_GROUP_SCHED" Date: Mon, 30 Jun 2014 18:05:40 +0200 Message-Id: <1404144343-18720-10-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404144343-18720-1-git-send-email-vincent.guittot@linaro.org> References: <1404144343-18720-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.128.173 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: , This reverts commit f5f9739d7a0ccbdcf913a0b3604b134129d14f7e. We are going to use runnable_avg_sum and runnable_avg_period in order to get the utilization of the CPU. This statistic includes all tasks that run the CPU and not only CFS tasks. Signed-off-by: Vincent Guittot --- kernel/sched/fair.c | 13 ++++++------- kernel/sched/sched.h | 4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 742ad88..bdc5cb9 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2428,19 +2428,12 @@ static inline void __update_group_entity_contrib(struct sched_entity *se) se->avg.load_avg_contrib >>= NICE_0_SHIFT; } } - -static inline void update_rq_runnable_avg(struct rq *rq, int runnable) -{ - __update_entity_runnable_avg(rq_clock_task(rq), &rq->avg, runnable); - __update_tg_runnable_avg(&rq->avg, &rq->cfs); -} #else /* CONFIG_FAIR_GROUP_SCHED */ static inline void __update_cfs_rq_tg_load_contrib(struct cfs_rq *cfs_rq, int force_update) {} static inline void __update_tg_runnable_avg(struct sched_avg *sa, struct cfs_rq *cfs_rq) {} static inline void __update_group_entity_contrib(struct sched_entity *se) {} -static inline void update_rq_runnable_avg(struct rq *rq, int runnable) {} #endif /* CONFIG_FAIR_GROUP_SCHED */ static inline void __update_task_entity_contrib(struct sched_entity *se) @@ -2539,6 +2532,12 @@ static void update_cfs_rq_blocked_load(struct cfs_rq *cfs_rq, int force_update) __update_cfs_rq_tg_load_contrib(cfs_rq, force_update); } +static inline void update_rq_runnable_avg(struct rq *rq, int runnable) +{ + __update_entity_runnable_avg(rq_clock_task(rq), &rq->avg, runnable); + __update_tg_runnable_avg(&rq->avg, &rq->cfs); +} + /* Add the load generated by se into cfs_rq's child load-average */ static inline void enqueue_entity_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se, diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 7b311de..fb53166 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -542,8 +542,6 @@ struct rq { #ifdef CONFIG_FAIR_GROUP_SCHED /* list of leaf cfs_rq on this cpu: */ struct list_head leaf_cfs_rq_list; - - struct sched_avg avg; #endif /* CONFIG_FAIR_GROUP_SCHED */ /* @@ -634,6 +632,8 @@ struct rq { #ifdef CONFIG_SMP struct llist_head wake_list; #endif + + struct sched_avg avg; }; static inline int cpu_of(struct rq *rq)