From: "T.Zhou" <t1zhou@163.com>
To: peterz@infradead.org
Cc: linux-kernel@vger.kernel.org, mingo@kernel.org
Subject: [PATCH] sched/fair: use user weight to calculate util_avg in post_init_entity_util_avg()
Date: Thu, 8 Dec 2016 09:27:22 +0800 [thread overview]
Message-ID: <20161208012722.GA4128@geo> (raw)
To calculate util_avg, se's weight should have the
same resolution as cfs->avg.load_avg. So use user
weight instead.
Signed-off-by: T.Zhou <t1zhou@163.com>
---
kernel/sched/fair.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 18d9e75..9799438 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -792,7 +792,8 @@ void post_init_entity_util_avg(struct sched_entity *se)
if (cap > 0) {
if (cfs_rq->avg.util_avg != 0) {
- sa->util_avg = cfs_rq->avg.util_avg * se->load.weight;
+ sa->util_avg = cfs_rq->avg.util_avg *
+ scale_load_down(se->load.weight);
sa->util_avg /= (cfs_rq->avg.load_avg + 1);
if (sa->util_avg > cap)
--
2.7.3
reply other threads:[~2016-12-08 1:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20161208012722.GA4128@geo \
--to=t1zhou@163.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=peterz@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.