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] [thread-next>] [day] [month] [year] [list]
Message-ID: <172494179975.2215.7791907589691817396.tip-bot2@tip-bot2>
Date: Thu, 29 Aug 2024 14:29:59 -0000
From: "tip-bot2 for Anna-Maria Behnsen" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: "Anna-Maria Behnsen" <anna-maria@...utronix.de>,
 Thomas Gleixner <tglx@...utronix.de>,
 "Rafael J. Wysocki" <rafael.j.wysocki@...el.com>, x86@...nel.org,
 linux-kernel@...r.kernel.org
Subject: [tip: timers/core] timers: Remove historical extra jiffie for timeout
 in msleep()

The following commit has been merged into the timers/core branch of tip:

Commit-ID:     4381b895f544bb84b8cfb34ada64df67c9b2a4f0
Gitweb:        https://git.kernel.org/tip/4381b895f544bb84b8cfb34ada64df67c9b2a4f0
Author:        Anna-Maria Behnsen <anna-maria@...utronix.de>
AuthorDate:    Thu, 29 Aug 2024 09:41:33 +02:00
Committer:     Thomas Gleixner <tglx@...utronix.de>
CommitterDate: Thu, 29 Aug 2024 16:17:18 +02:00

timers: Remove historical extra jiffie for timeout in msleep()

msleep() and msleep_interruptible() add a jiffie to the requested timeout.

This extra jiffie was introduced to ensure that the timeout will not happen
earlier than specified.

Since the rework of the timer wheel, the enqueue path already takes care of
this. So the extra jiffie added by msleep*() is pointless now.

Remove this extra jiffie in msleep() and msleep_interruptible().

Signed-off-by: Anna-Maria Behnsen <anna-maria@...utronix.de>
Signed-off-by: Thomas Gleixner <tglx@...utronix.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@...el.com>
Link: https://lore.kernel.org/all/20240829074133.4547-1-anna-maria@linutronix.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 429232d..d8eb368 100644
--- a/kernel/time/timer.c
+++ b/kernel/time/timer.c
@@ -2732,7 +2732,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);
@@ -2746,7 +2746,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);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ