Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/all/20240829074133.4547-1-anna-maria@linutronix.de

authored by

Anna-Maria Behnsen and committed by
Thomas Gleixner
4381b895 ed4fb6d7

+2 -2
+2 -2
kernel/time/timer.c
··· 2732 2732 */ 2733 2733 void msleep(unsigned int msecs) 2734 2734 { 2735 - unsigned long timeout = msecs_to_jiffies(msecs) + 1; 2735 + unsigned long timeout = msecs_to_jiffies(msecs); 2736 2736 2737 2737 while (timeout) 2738 2738 timeout = schedule_timeout_uninterruptible(timeout); ··· 2746 2746 */ 2747 2747 unsigned long msleep_interruptible(unsigned int msecs) 2748 2748 { 2749 - unsigned long timeout = msecs_to_jiffies(msecs) + 1; 2749 + unsigned long timeout = msecs_to_jiffies(msecs); 2750 2750 2751 2751 while (timeout && !signal_pending(current)) 2752 2752 timeout = schedule_timeout_interruptible(timeout);