Skip to content

Commit ab522e3

Browse files
deggemanIngo Molnar
authored andcommitted
sched/fair: Fix fixed point arithmetic width for shares and effective load
Since commit: 2159197 ("sched/core: Enable increased load resolution on 64-bit kernels") we now have two different fixed point units for load: - 'shares' in calc_cfs_shares() has 20 bit fixed point unit on 64-bit kernels. Therefore use scale_load() on MIN_SHARES. - 'wl' in effective_load() has 10 bit fixed point unit. Therefore use scale_load_down() on tg->shares which has 20 bit fixed point unit on 64-bit kernels. Signed-off-by: Dietmar Eggemann <[email protected]> Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Mike Galbraith <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 8f37961 commit ab522e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/sched/fair.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5017,9 +5017,9 @@ static long effective_load(struct task_group *tg, int cpu, long wl, long wg)
50175017
* wl = S * s'_i; see (2)
50185018
*/
50195019
if (W > 0 && w < W)
5020-
wl = (w * (long)tg->shares) / W;
5020+
wl = (w * (long)scale_load_down(tg->shares)) / W;
50215021
else
5022-
wl = tg->shares;
5022+
wl = scale_load_down(tg->shares);
50235023

50245024
/*
50255025
* Per the above, wl is the new se->load.weight value; since

0 commit comments

Comments
 (0)