lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20161208012722.GA4128@geo>
Date:   Thu, 8 Dec 2016 09:27:22 +0800
From:   "T.Zhou" <t1zhou@....com>
To:     peterz@...radead.org
Cc:     linux-kernel@...r.kernel.org, mingo@...nel.org
Subject: [PATCH] sched/fair: use user weight to calculate util_avg in
 post_init_entity_util_avg()

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ