lkml.org 
[lkml]   [2015]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2] sched,fair: Remove > u32 weight handling for delta
Date
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@gmail.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


\
 
 \ /
  Last update: 2015-07-06 20:41    [W:0.077 / U:2.080 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site