lkml.org 
[lkml]   [2015]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] sched/fair: fix incorrect calculation of capacity in scale_rt_capacity
Date
Ping.

> -----Original Message-----
> From: Chao Yu [mailto:chao2.yu@samsung.com]
> Sent: Wednesday, September 23, 2015 2:16 PM
> To: 'mingo@redhat.com'; 'peterz@infradead.org'
> Cc: 'linux-kernel@vger.kernel.org'
> Subject: [PATCH] sched/fair: fix incorrect calculation of capacity in scale_rt_capacity
>
> div_u64 can only handle 32-bits divisor, if our divisor is with type of
> 64-bits, we should use div64_u64 instead, otherwise value of divisor will
> be cast to 32-bits, resulting in wrong calculation.
>
> Signed-off-by: Chao Yu <chao2.yu@samsung.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index 9176f7c..ee268ef 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -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




\
 
 \ /
  Last update: 2015-09-29 04:01    [W:0.047 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site