nsecs_to_jiffies(9)
π 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 inu64, 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:
jiffies_to_msecs(9)jiffies_to_usecs(9)mktime64(9)set_normalized_timespec64(9)ns_to_timespec64(9)__msecs_to_jiffies(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)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)
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
- 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