sched/fair: fix incorrect calculation of capacity in scale_rt_capacity
Ping.
Quoted 31 lines
-----Original Message-----
From: Chao Yu [mailto:[email protected]]
Sent: Wednesday, September 23, 2015 2:16 PM
To: '[email protected]'; '[email protected]'
Cc: '[email protected]'
Subject: [PATCH] sched/fair: fix incorrect calculation of capacity inscale_rt_capacity
div_u64can only handle 32-bits divisor, if our divisor is with type of 64-bits, we should usediv64_u64instead, otherwise value of divisor will be cast to 32-bits, resulting in wrong calculation.Signed-off-by Chao Yu <[email protected]>--- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)kernel/sched/fair.c +1
-2@@ -6086,7 +6086,7 @@ static unsigned long scale_rt_capacity(int cpu) total =sched_avg_period () + delta; - used =div_u64 (avg, total); + used =div64_u64 (avg, total);if (likely (used <SCHED_CAPACITY_SCALE ))return SCHED_CAPACITY_SCALE - used; --2.5.2