lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-id: <009301d0fa58$1986b8f0$4c942ad0$@samsung.com>
Date:	Tue, 29 Sep 2015 09:41:32 +0800
From:	Chao Yu <chao2.yu@...sung.com>
To:	mingo@...hat.com, peterz@...radead.org
Cc:	linux-kernel@...r.kernel.org
Subject: RE: [PATCH] sched/fair: fix incorrect calculation of capacity in
 scale_rt_capacity

Ping.

> -----Original Message-----
> From: Chao Yu [mailto:chao2.yu@...sung.com]
> Sent: Wednesday, September 23, 2015 2:16 PM
> To: 'mingo@...hat.com'; 'peterz@...radead.org'
> Cc: 'linux-kernel@...r.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@...sung.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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ