Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp27046ybd; Fri, 28 Jun 2019 13:50:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzOuBI1m0aYorVlTSMqoN1lgVedjNcCBrkdplhIann66N+butSMD/SwVr3N6gzetZeXJ7Ev X-Received: by 2002:a63:18c:: with SMTP id 134mr10849978pgb.432.1561755027681; Fri, 28 Jun 2019 13:50:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561755027; cv=none; d=google.com; s=arc-20160816; b=mIkPpdijX9PzfkNyFxty4pmPMQqBacYSb/xVV8Cprc6NvrbWTLiysJhqFLwFiiANBd L5HO2l2hjY87S/dBWKo/4GK1NSuTC6Dz2Zv6mlUZKTtSe3v6Lq+5+E5oVxfWjj/ZQh1X rgK5bsoSBKIkTju9ywvvFjqkmNtSitSN7zHNHLszR3ftJut3MQoDswKGLAo1MmPEoh7K xntqWlQhUfjiGagDeiCGMbr74uk4RS0TN661Zk9rV0Xr8l7u2wXCrSXE/f3o6tun0i4d V1w/4dO24pgJuAtNzYCeviKDXDy+SugRfpRMSvKv3zLSte1YeqGvXyvZQ0UWtOAD3hNQ O3lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Ksxax4re91jYOubctQ7zmiWb0qdEzFWxiz80TG22QFc=; b=nlKd5CLW3ryKpE2jWbYLdrK5ckxftzo92ygAzUpbNweOn3z1AwcFc32yiC3hvJIGi/ 42gzJA7ZM04JeOhXEvHLBtpZgwB1TrovFKb6WsNFi8UDkee7QdQoZ0VcQRt2ojLCCwyf 08dWxUzH7273UDcry1cGX6kNY3hrPJ34yDmX5ClQIpdj67/yp7g5nqCgVoG1daOnXBe/ CRZ5Oc2pMusDODpB7q8moOT+Un1bztkknUuSUVxDk1SbAgbhC7BGI+rJIdjiRz+l8b7W XxDMeXpM5WUov+gLeDggKIMkTCKC3FRdo/Pj9SWB6PWpRp05M4vMe2tfdg2UzKgE70qN JVSA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k9si3543669pfh.56.2019.06.28.13.49.49; Fri, 28 Jun 2019 13:50:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726895AbfF1Uti (ORCPT + 99 others); Fri, 28 Jun 2019 16:49:38 -0400 Received: from shelob.surriel.com ([96.67.55.147]:38410 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725783AbfF1Utg (ORCPT ); Fri, 28 Jun 2019 16:49:36 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hgxo6-0007TL-J2; Fri, 28 Jun 2019 16:49:18 -0400 From: Rik van Riel To: linux-kernel@vger.kernel.org Cc: kernel-team@fb.com, pjt@google.com, dietmar.eggemann@arm.com, peterz@infradead.org, mingo@redhat.com, morten.rasmussen@arm.com, tglx@linutronix.de, mgorman@techsingularity.net, vincent.guittot@linaro.org, Rik van Riel Subject: [PATCH 04/10] sched,fair: move runnable_load_avg to cfs_rq Date: Fri, 28 Jun 2019 16:49:07 -0400 Message-Id: <20190628204913.10287-5-riel@surriel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190628204913.10287-1-riel@surriel.com> References: <20190628204913.10287-1-riel@surriel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since only the root cfs_rq runnable_load_avg field is used any more, we can move the field from struct sched_avg, which every sched_entity has one of, directly into the struct cfs_rq, of which we have way fewer. No functional changes. Suggested-by: Dietmar Eggemann Signed-off-by: Rik van Riel --- include/linux/sched.h | 1 - kernel/sched/debug.c | 3 +-- kernel/sched/fair.c | 8 ++++---- kernel/sched/sched.h | 1 + 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index f5bb6948e40c..84a6cc6f5c47 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -394,7 +394,6 @@ struct sched_avg { u32 util_sum; u32 period_contrib; unsigned long load_avg; - unsigned long runnable_load_avg; unsigned long util_avg; struct util_est util_est; } ____cacheline_aligned; diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c index cefc1b171c0b..6e7c8ff210a8 100644 --- a/kernel/sched/debug.c +++ b/kernel/sched/debug.c @@ -539,7 +539,7 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) SEQ_printf(m, " .%-30s: %lu\n", "load_avg", cfs_rq->avg.load_avg); SEQ_printf(m, " .%-30s: %lu\n", "runnable_load_avg", - cfs_rq->avg.runnable_load_avg); + cfs_rq->runnable_load_avg); SEQ_printf(m, " .%-30s: %lu\n", "util_avg", cfs_rq->avg.util_avg); SEQ_printf(m, " .%-30s: %u\n", "util_est_enqueued", @@ -960,7 +960,6 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, P(se.avg.load_sum); P(se.avg.util_sum); P(se.avg.load_avg); - P(se.avg.runnable_load_avg); P(se.avg.util_avg); P(se.enqueued_h_load); P(se.avg.last_update_time); diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 860708b687a7..63cb40253b26 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -2768,7 +2768,7 @@ enqueue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) struct cfs_rq *root_cfs_rq = &cfs_rq->rq->cfs; se->enqueued_h_load = task_se_h_load(se); - root_cfs_rq->avg.runnable_load_avg += se->enqueued_h_load; + root_cfs_rq->runnable_load_avg += se->enqueued_h_load; } } @@ -2777,7 +2777,7 @@ dequeue_runnable_load_avg(struct cfs_rq *cfs_rq, struct sched_entity *se) { if (entity_is_task(se)) { struct cfs_rq *root_cfs_rq = &cfs_rq->rq->cfs; - sub_positive(&root_cfs_rq->avg.runnable_load_avg, + sub_positive(&root_cfs_rq->runnable_load_avg, se->enqueued_h_load); } } @@ -2795,7 +2795,7 @@ update_runnable_load_avg(struct sched_entity *se) new_h_load = task_se_h_load(se); delta = new_h_load - se->enqueued_h_load; - root_cfs_rq->avg.runnable_load_avg += delta; + root_cfs_rq->runnable_load_avg += delta; se->enqueued_h_load = new_h_load; } @@ -3559,7 +3559,7 @@ static void remove_entity_load_avg(struct sched_entity *se) static inline unsigned long cfs_rq_runnable_load_avg(struct cfs_rq *cfs_rq) { - return cfs_rq->avg.runnable_load_avg; + return cfs_rq->runnable_load_avg; } static inline unsigned long cfs_rq_load_avg(struct cfs_rq *cfs_rq) diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 5be14cee61f9..32978a8de8ce 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -516,6 +516,7 @@ struct cfs_rq { * CFS load tracking */ struct sched_avg avg; + unsigned long runnable_load_avg; #ifndef CONFIG_64BIT u64 load_last_update_time_copy; #endif -- 2.20.1