usecs_to_jiffies(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… usecs_to_jiffies (Kernel API Manual)

Ok so bestie, buckle up β€” this one lives in the Kernel API Manual and it's literally the glow-up translator for time units. It takes microseconds and turns them into jiffies. Slay.


✨ NAME ✨

usecs_to_jiffies β€” convert microseconds to jiffies πŸ•βž‘οΈπŸŽ€


🌸 SYNOPSIS 🌸

unsigned long usecs_to_jiffies (const unsigned int u );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • u β€” the time, in microseconds. That's it, that's the whole input. πŸ“

πŸ’– DESCRIPTION πŸ’–

So the conversion is done as follows, bestie β€” pay attention, this is the whole vibe:

  • MAX_JIFFY_OFFSET values] mean 'infinite timeout' too.
  • 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 as for msecs_to_jiffies.

usecs_to_jiffies checks for the passed in value being a constant via __builtin_constant_p, which is honestly iconic of it β€” it lets gcc eliminate most of the code. πŸ”₯

Then __usecs_to_jiffies gets called if the value passed does not allow constant folding and the actual conversion must be done at runtime. And the HZ range specific helpers _usecs_to_jiffies are called both directly here and from __msecs_to_jiffies in the case where constant folding is not possible. The way this thing multitasks πŸ˜­πŸ‘‘


πŸ‘‘ RETURN πŸ‘‘

The jiffies value. πŸ’«


🌈 SEE ALSO 🌈

Kernel file ./include/linux/jiffies.h, plus the whole friend group:


🫢 Ok that's the whole page! This little gem comes from ./include/linux, dated October 2026, and it's filed under usecs_to_jiffies(9). Go forth and convert, bestie β€” no cap, you got this. πŸ’œβœ¨

πŸ“¦ where this page comes from