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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon,  6 Jul 2015 23:49:15 +0530
From:	Afzal Mohammed <afzal.mohd.ma@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Ingo Molnar <mingo@...hat.com>,
	Peter Zijlstra <peterz@...radead.org>,
	Afzal Mohammed <afzal.mohd.ma@...il.com>
Subject: [PATCH v2] sched,fair: Remove > u32 weight handling for delta

scaled down weight 'fact' would not be > u32 rather than unlikely as the
weight being passed in __calc_delta() is either 'se->load.weight' or
NICE_O_LOAD. 'se->load.weight' would be one of the values of
prio_to_weight[] in the case of task, while in the case of task group it
would be capped to MAX_SHARES. All those possible values can fit in u32.
Hence remove the initial > u32 handling on 'fact'.

Signed-off-by: Afzal Mohammed <afzal.mohd.ma@...il.com>
---

v2: expand change log on why weight can fit in u32, remove incorrect
    comments.

 kernel/sched/fair.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 65c8f3ebdc3c..22cf3958bbac 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -218,13 +218,6 @@ static u64 __calc_delta(u64 delta_exec, unsigned long weight, struct load_weight
 
 	__update_inv_weight(lw);
 
-	if (unlikely(fact >> 32)) {
-		while (fact >> 32) {
-			fact >>= 1;
-			shift--;
-		}
-	}
-
 	/* hint to use a 32x32->64 mul */
 	fact = (u64)(u32)fact * lw->inv_weight;
 
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ