From: "tip-bot2 for Dietmar Eggemann" <tip-bot2@linutronix.de>
To: linux-tip-commits@vger.kernel.org
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
"Peter Zijlstra (Intel)" <peterz@infradead.org>,
Vincent Guittot <vincent.guittot@linaro.org>,
x86@kernel.org, linux-kernel@vger.kernel.org
Subject: [tip: sched/core] sched/fair: Return early from update_tg_cfs_load() if delta == 0
Date: Fri, 18 Jun 2021 08:46:07 -0000 [thread overview]
Message-ID: <162400596716.19906.6497557861624006450.tip-bot2@tip-bot2> (raw)
In-Reply-To: <20210601083616.804229-1-dietmar.eggemann@arm.com>
The following commit has been merged into the sched/core branch of tip:
Commit-ID: 83c5e9d573e1f0757f324d01adb6ee77b49c3f0e
Gitweb: https://git.kernel.org/tip/83c5e9d573e1f0757f324d01adb6ee77b49c3f0e
Author: Dietmar Eggemann <dietmar.eggemann@arm.com>
AuthorDate: Tue, 01 Jun 2021 10:36:16 +02:00
Committer: Peter Zijlstra <peterz@infradead.org>
CommitterDate: Thu, 17 Jun 2021 14:11:42 +02:00
sched/fair: Return early from update_tg_cfs_load() if delta == 0
In case the _avg delta is 0 there is no need to update se's _avg
(level n) nor cfs_rq's _avg (level n-1). These values stay the same.
Since cfs_rq's _avg isn't changed, i.e. no load is propagated down,
cfs_rq's _sum should stay the same as well.
So bail out after se's _sum has been updated.
Signed-off-by: Dietmar Eggemann <dietmar.eggemann@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Vincent Guittot <vincent.guittot@linaro.org>
Link: https://lore.kernel.org/r/20210601083616.804229-1-dietmar.eggemann@arm.com
---
kernel/sched/fair.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 198514d..06c8ba7 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -3502,9 +3502,12 @@ update_tg_cfs_load(struct cfs_rq *cfs_rq, struct sched_entity *se, struct cfs_rq
load_sum = (s64)se_weight(se) * runnable_sum;
load_avg = div_s64(load_sum, divider);
+ se->avg.load_sum = runnable_sum;
+
delta = load_avg - se->avg.load_avg;
+ if (!delta)
+ return;
- se->avg.load_sum = runnable_sum;
se->avg.load_avg = load_avg;
add_positive(&cfs_rq->avg.load_avg, delta);
prev parent reply other threads:[~2021-06-18 8:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-01 8:36 [PATCH] sched/fair: Return early from update_tg_cfs_load() if delta == 0 Dietmar Eggemann
2021-06-01 14:11 ` Vincent Guittot
2021-06-18 8:46 ` tip-bot2 for Dietmar Eggemann [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=162400596716.19906.6497557861624006450.tip-bot2@tip-bot2 \
--to=tip-bot2@linutronix.de \
--cc=dietmar.eggemann@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=vincent.guittot@linaro.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).