nsecs_to_jiffies64(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ nsecs_to_jiffies64 ✨

okay so bestie, welcome to the nsecs_to_jiffies64 page πŸ’– this little angel lives in the Kernel API Manual (section 9, kernel devs only, iykyk) and it literally just... converts nanoseconds into jiffies. that's it. that's the whole vibe. but the way it does it is actually kind of iconic so let's get into it πŸŽ€


🌸 NAME 🌸

nsecs_to_jiffies64 β€” convert nsecs in u64 to jiffies64 πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

u64 nsecs_to_jiffies64 (u64 n );

that's the whole signature, no cap. one input, one output, main character energy ✨


πŸ’œ ARGUMENTS πŸ’œ

  • n β€” nsecs in u64. that's your nanoseconds, babe, and it's a u64 not some tiny unsigned int, okay? we don't do small here 🫢

🌈 DESCRIPTION 🌈

so like, here's the tea β˜• β€” unlike {m,u}secs_to_jiffies, the type of input here is not unsigned int, it's u64. bigger. stronger. more room for your nanoseconds. she ate πŸ’…

and here's the other thing: this function doesn't return MAX_JIFFY_OFFSET, because it's designed for the scheduler, not for use in device drivers to calculate timeout value. periodt. so if you're a device driver trying to use this for timeouts β€” no bestie, that's not your lane πŸ™ˆ


⭐ NOTE ⭐

okay this part is giving math class but it's lowkey cute, stay with me 🧚

NSEC_PER_SEC = 10^9 = (5^9 * 2^9) = (1953125 * 512)

and like, ULLONG_MAX ns = 18446744073.709551615 secs = about 584 years 😭 so yeah, you're probably fine, nobody's waiting around that long fr fr


πŸ”₯ RETURN πŸ”₯

nsecs converted to jiffies64 value πŸ’– that's it, that's the return, she's simple and she's slaying


πŸ‘‘ SEE ALSO πŸ‘‘

okay bestie, grab a snack, this list is long but we're doing it, no skipping πŸ“

Kernel file ./kernel/time/time.c:

like I said. a whole friend group 😭 but they're all iconic, go say hi 🫢


okay that's the page!! this one came from ./kernel/time and it's dated October 2026 β€” so yeah, fresh off the press, timestamped and everything πŸ“…βœ¨ mwah, love u, go convert some nanoseconds bestie πŸ’…πŸ’–

πŸ“¦ where this page comes from