Messages in this thread Patch in this message | | | From | Afzal Mohammed <> | Subject | [PATCH v2] sched,fair: Remove > u32 weight handling for delta | Date | Mon, 6 Jul 2015 23:49:15 +0530 |
| |
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
| |