usleep_range_idle(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’€ usleep_range_idle(9) β€” the Kernel API Manual, bestie edition πŸ’€

okay so real talk, this one lives in the Kernel API Manual, section 9, and it's called usleep_range_idle. it's the nap function that also keeps the receipts on idle time, and honestly? iconic behavior.


✨ NAME ✨

usleep_range_idle β€” sleep for an approximate time, but make it accounted-for idle time πŸ›Œβœ¨


πŸŽ€ SYNOPSIS πŸŽ€

void usleep_range_idle (unsigned long min , unsigned long max );

like, that's it. that's the whole signature. no cap. πŸ’…


🌸 ARGUMENTS 🌸

  • min β€” the minimum time to sleep, measured in microseconds ⏱️ (yes, *micro*seconds, keep up bestie)
  • max β€” the maximum time to sleep, also in microseconds 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

so for the basic rundown you gotta go check out usleep_range_state β€” that's the main character, this one's the spin-off. πŸ‘‘

here's the tea though: while the task is sleeping, it's sitting in the TASK_IDLE state. and why do we care? because that means it doesn't contribute to the load average. literally not showing up in the group chat. it's asleep and it's off the books in the load average sense. πŸ’€βœ¨


πŸ’– SEE ALSO πŸ’–

kernel file ./include/linux/delay.h β€” and its whole friend group:


ok that's the whole page, no gatekeeping here πŸŽ€ go take a nap (an accounted-for nap), you earned it 🌈

and that's a wrap, bestie!! this one shipped out of ./include/linux back in October 2026 β€” mwah, slay, see you in the kernel source πŸ«ΆπŸ’œπŸ§š

πŸ“¦ where this page comes from