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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAJvTdKkejPZL0vYngm1w=ao09mzCn7x3MYFWJkFhDh8ZUFkwzw@mail.gmail.com>
Date: Fri, 30 Aug 2024 01:41:16 -0400
From: Len Brown <lenb@...nel.org>
To: Anna-Maria Behnsen <anna-maria@...utronix.de>
Cc: linux-kernel@...r.kernel.org, Frederic Weisbecker <frederic@...nel.org>, 
	Thomas Gleixner <tglx@...utronix.de>, "Rafael J . Wysocki" <rafael@...nel.org>
Subject: Re: [PATCH] timers: Remove historical extra jiffie for timeout in msleep()

HZ=250 systems thank you!

Acked-by: Len Brown <len.brown@...el.com>

On Thu, Aug 29, 2024 at 3:41 AM Anna-Maria Behnsen
<anna-maria@...utronix.de> wrote:
>
> msleep() as well as msleep_interruptible() add a jiffie to the
> timeout. This extra jiffie was introduced in former days to ensure timeout
> will not happen earlier than specified. But the timer wheel already takes
> care during enqueue that timers will not expire earlier than specified.
>
> Remove this extra jiffie in msleep() and msleep_interruptible().
>
> Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
> ---
>  kernel/time/timer.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/time/timer.c b/kernel/time/timer.c
> index 64b0d8a0aa0f..18aa759c3cae 100644
> --- a/kernel/time/timer.c
> +++ b/kernel/time/timer.c
> @@ -2730,7 +2730,7 @@ void __init init_timers(void)
>   */
>  void msleep(unsigned int msecs)
>  {
> -       unsigned long timeout = msecs_to_jiffies(msecs) + 1;
> +       unsigned long timeout = msecs_to_jiffies(msecs);
>
>         while (timeout)
>                 timeout = schedule_timeout_uninterruptible(timeout);
> @@ -2744,7 +2744,7 @@ EXPORT_SYMBOL(msleep);
>   */
>  unsigned long msleep_interruptible(unsigned int msecs)
>  {
> -       unsigned long timeout = msecs_to_jiffies(msecs) + 1;
> +       unsigned long timeout = msecs_to_jiffies(msecs);
>
>         while (timeout && !signal_pending(current))
>                 timeout = schedule_timeout_interruptible(timeout);
> --
> 2.39.2
>


-- 
Len Brown, Intel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ