__msecs_to_jiffies(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ __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_OFFSET values] 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:


πŸ’Œ source/version: ./kernel/time β€” October 2026 β€” __msecs_to_jiffies(9) πŸ’Œ

πŸ“¦ where this page comes from