aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnna-Maria Behnsen <[email protected]>2024-08-29 09:41:33 +0200
committerThomas Gleixner <[email protected]>2024-08-29 16:17:18 +0200
commit4381b895f544bb84b8cfb34ada64df67c9b2a4f0 (patch)
tree57ae0fded11150c58c5d4e4e98577b49e6de060c
parented4fb6d7ef68111bb539283561953e5c6e9a6e38 (diff)
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 <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Link: https://lore.kernel.org/all/[email protected]
-rw-r--r--kernel/time/timer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/time/timer.c b/kernel/time/timer.c
index 429232d8659a..d8eb368a5a5b 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);