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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20221115120239.GA721394@lothringen>
Date:   Tue, 15 Nov 2022 13:02:39 +0100
From:   Frederic Weisbecker <frederic@...nel.org>
To:     Yun Zhou <yun.zhou@...driver.com>
Cc:     jstultz@...gle.com, tglx@...utronix.de, sboyd@...nel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] timers: fix LVL_START macro

Hi Yun Zhou,

On Tue, Nov 15, 2022 at 10:56:14AM +0800, Yun Zhou wrote:
> The number of buckets per level should be LVL_SIZE, not LVL_SIZE-1.
> 
> Signed-off-by: Yun Zhou <yun.zhou@...driver.com>
> ---
>  kernel/time/timer.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 717fcb9fb14a..1116b208093e 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -161,7 +161,7 @@ EXPORT_SYMBOL(jiffies_64);
>   * time. We start from the last possible delta of the previous level
>   * so that we can later add an extra LVL_GRAN(n) to n (see calc_index()).
>   */
> -#define LVL_START(n)	((LVL_SIZE - 1) << (((n) - 1) * LVL_CLK_SHIFT))
> +#define LVL_START(n)	(LVL_SIZE << (((n) - 1) * LVL_CLK_SHIFT))

See the comment above:

   "We start from the last possible delta of the previous level
    so that we can later add an extra LVL_GRAN(n) to n (see calc_index())."

Thanks.

>  
>  /* Size of each clock level */
>  #define LVL_BITS	6
> -- 
> 2.35.2
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ