From patchwork Fri May 23 15:53:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 30827 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f197.google.com (mail-ve0-f197.google.com [209.85.128.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ADBDD20369 for ; Fri, 23 May 2014 15:55:36 +0000 (UTC) Received: by mail-ve0-f197.google.com with SMTP id db11sf18452755veb.0 for ; Fri, 23 May 2014 08:55:36 -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=sPa7Wb2y9JfbPFMGUvh8UOQ8zmyZJFKvJWIcqI3mpLQ=; b=Rj0Bnv5tYMKfzgMAIx5h0fW3ljQC3E0xtkeM8Jp8EtGjLL5OauDg2EWLYE4ViJv7ny ifIiRThmRxTBSlEL0FAISRzTm9fG3/+iWstovahFHd9SRpWp5W76DtyITEwdLiVoVdjo BhbV4xPn+U+8t8HhfMf7aOniaMHBnsjEphyRKGbT5PmDrZiOBXN7zfSvInE2CYO1Bx05 RHcW1nFjc1kP5fF32j8zNp/6V7zRCEmfovmR3RtVcJ/JVa0WRNsHeelq6Kh0TUmShuGL WTKn1yhZHZtxn2dYuET9LIxPRCGMSeAxBXoUDS0l5dXMycw75QPrAuZJmAHOpt9lupD/ 4JUQ== X-Gm-Message-State: ALoCoQlYYNoat6iYWAf8azksODbjzmcBx9jYJ4/xh0rT0ksmNYfE9AFEAQC+hjgeBBeWeICHV0M9 X-Received: by 10.236.209.97 with SMTP id r61mr2330428yho.33.1400860536528; Fri, 23 May 2014 08:55:36 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.42.111 with SMTP id b102ls1857192qga.31.gmail; Fri, 23 May 2014 08:55:36 -0700 (PDT) X-Received: by 10.52.94.47 with SMTP id cz15mr4258586vdb.0.1400860536445; Fri, 23 May 2014 08:55:36 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id uk3si1867103vec.102.2014.05.23.08.55.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:55:36 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.170 as permitted sender) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so6454792vcb.15 for ; Fri, 23 May 2014 08:55:36 -0700 (PDT) X-Received: by 10.58.185.165 with SMTP id fd5mr1967141vec.41.1400860536324; Fri, 23 May 2014 08:55:36 -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.220.221.72 with SMTP id ib8csp42799vcb; Fri, 23 May 2014 08:55:35 -0700 (PDT) X-Received: by 10.66.162.137 with SMTP id ya9mr7206155pab.31.1400860535574; Fri, 23 May 2014 08:55:35 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sl2si4384319pbc.221.2014.05.23.08.55.35 for ; Fri, 23 May 2014 08:55:35 -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 S1753049AbaEWPyW (ORCPT + 27 others); Fri, 23 May 2014 11:54:22 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:37740 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752856AbaEWPyT (ORCPT ); Fri, 23 May 2014 11:54:19 -0400 Received: by mail-wg0-f48.google.com with SMTP id k14so787178wgh.19 for ; Fri, 23 May 2014 08:54:17 -0700 (PDT) X-Received: by 10.180.99.40 with SMTP id en8mr4183147wib.24.1400860457846; Fri, 23 May 2014 08:54:17 -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.15 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 23 May 2014 08:54:17 -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, Vincent Guittot Subject: [PATCH v2 07/11] Revert "sched: Put rq's sched_avg under CONFIG_FAIR_GROUP_SCHED" Date: Fri, 23 May 2014 17:53:01 +0200 Message-Id: <1400860385-14555-8-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> 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.220.170 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 b3dc2b3..b7c51be 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2427,19 +2427,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) @@ -2538,6 +2531,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 4c74014..929ee6c 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)