__msecs_to_jiffies(9)
β¨ __msecs_to_jiffies β¨
hey bestie, welcome to the Kernel API Manual π this page is all about __msecs_to_jiffies, and it's literally converting milliseconds to jiffies. no cap. π°οΈβ‘οΈβ¨
πΈ NAME πΈ
__msecs_to_jiffies - - convert milliseconds to jiffies. that's the whole assignment, bestie: milliseconds in, jiffies out. π
β¨ SYNOPSIS β¨
unsigned long __msecs_to_jiffies (const unsigned int m );
π ARGUMENTS π
mβ time in milliseconds. yes, just the time in millis. β±οΈ
π¦ DESCRIPTION π¦
okay so the conversion is done as follows, and I need you to stay with me:
- negative values mean 'infinite timeout' (
MAX_JIFFY_OFFSET) β negative is giving forever energy, bestie βΎοΈπ MAX_JIFFY_OFFSETvalues] mean 'infinite timeout' too. yup, same forever vibe. βΎοΈ- all other values are converted to jiffies by either multiplying the input value by a factor or dividing it with a factor and handling any 32-bit overflows. for the details see
_msecs_to_jiffies. multiply or divide by a factor, handle those 32-bit overflows like a boss ππ₯
msecs_to_jiffies checks for the passed in value being a constant via __builtin_constant_p allowing gcc to eliminate most of the code. __msecs_to_jiffies is called if the value passed does not allow constant folding and the actual conversion must be done at runtime. The _msecs_to_jiffies helpers are the HZ dependent conversion routines found in include/linux/jiffies.h. π«Ά
π« RETURN π«
jiffies value. that's it β the return is a jiffies value. periodt. β
π SEE ALSO π
Kernel file ./kernel/time/time.c β and here's the whole friend group, bestie:
jiffies_to_msecs(9)jiffies_to_usecs(9)mktime64(9)set_normalized_timespec64(9)ns_to_timespec64(9)__usecs_to_jiffies(9)timespec64_to_jiffies(9)jiffies_to_timespec64(9)jiffies_to_clock_t(9)clock_t_to_jiffies(9)jiffies_64_to_clock_t(9)nsec_to_clock_t(9)jiffies64_to_nsecs(9)jiffies64_to_msecs(9)nsecs_to_jiffies64(9)nsecs_to_jiffies(9)timespec64_add_safe(9)get_timespec64(9)put_timespec64(9)get_old_timespec32(9)put_old_timespec32(9)get_itimerspec64(9)put_itimerspec64(9)get_old_itimerspec32(9)put_old_itimerspec32(9)
π source/version: ./kernel/time β October 2026 β __msecs_to_jiffies(9) π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms