linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sched/fair: use user weight to calculate util_avg in post_init_entity_util_avg()
@ 2016-12-08  1:27 T.Zhou
  0 siblings, 0 replies; only message in thread
From: T.Zhou @ 2016-12-08  1:27 UTC (permalink / raw)
  To: peterz; +Cc: linux-kernel, mingo

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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-08  1:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-08  1:27 [PATCH] sched/fair: use user weight to calculate util_avg in post_init_entity_util_avg() T.Zhou

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).