cpuidle_select(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ cpuidle_select β€” the kernel API manual, bestie edition πŸ¦‹

okay so real talk, this one's from the kernel API manual and it's literally the moment your CPU is like "hmm which nap should I take" and this function is the one that picks πŸ’…


✨ NAME ✨

cpuidle_select β€” bestie, it literally asks the cpuidle framework to choose an idle state πŸ›Œβœ¨


🌸 SYNOPSIS 🌸

int cpuidle_select (struct cpuidle_driver *drv , struct cpuidle_device
*dev , bool *stop_tick );

no cap, that's the whole signature, exactly as written, don't come for me about the spacing 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • drv β€” the cpuidle driver. your driver. the one calling the shots πŸš—
  • dev β€” the cpuidle device. the device in question, iconic, we love them 🫢
  • stop_tick β€” the indication on whether or not to stop the tick ⏰ it's giving "yes or no, the tick edition"

πŸ’– DESCRIPTION πŸ’–

so like, this returns the index of the idle state πŸ‘‘ β€” the index, periodt. and the return value must not be negative πŸ™…β€β™€οΈ no negative values allowed, that's the rule, that's the vibe check, that's non-negotiable.

the memory location pointed to by stop_tick is expected to be written the entering the returned state 🫧 β€” yes that's the sentence, verbatim, she's a little mysterious but she's doing her best πŸ’€


🌈 SEE ALSO 🌈

literally the whole cpuidle friend group, they all show up together, iykyk:

Kernel file ./drivers/cpuidle/cpuidle.c


ok and a lil sign-off fr fr: this whole page lives over in ./drivers/cpuidle, dated October 2026, and it's cpuidle_select(9) bestie β€” stan her, cite her, don't return negative from her πŸ’œβœ¨
πŸ“¦ where this page comes from