nsecs_to_jiffies(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

okay bestie, welcome to nsecs_to_jiffies(9) from the Kernel API Manual β€” this is the function that converts nsecs in u64 to jiffies. no cap, she’s iconic. πŸ’…βœ¨

🌸 SYNOPSIS 🌸

unsigned long nsecs_to_jiffies (u64 n );

πŸŽ€ ARGUMENTS πŸŽ€

  • n β€” nsecs in u64, that’s the whole mood 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So here’s the tea: unlike {m,u}secs_to_jiffies, the type of input here is not unsigned int but u64. and this doesn’t return MAX_JIFFY_OFFSET, because this function is designed for scheduler, not for use in device drivers to calculate timeout value. periodt. πŸ’€βœ¨

⭐ NOTE ⭐

okay nerd moment, the note is literally this:

       NSEC_PER_SEC = 10^9 = (5^9 * 2^9) = (1953125 * 512) ULLONG_MAX ns =
       18446744073.709551615 secs = about 584 years

πŸ’… RETURN πŸ’…

boom: nsecs converted to jiffies value. slay. πŸ”₯

🌈 SEE ALSO 🌈

Kernel file ./kernel/time/time.c is the spot, and here’s the full friend group:


byeee from the ./kernel/time source, dated October 2026 β€” this was nsecs_to_jiffies(9), signing off with main character energy. πŸ’–βœ¨

πŸ“¦ where this page comes from