cpuidle_select(9)
π¦ 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
cpuidle_play_dead(9)cpuidle_use_deepest_state(9)cpuidle_find_deepest_state(9)cpuidle_enter_s2idle(9)cpuidle_enter_state(9)cpuidle_enter(9)cpuidle_reflect(9)cpuidle_poll_time(9)cpuidle_install_idle_handler(9)cpuidle_uninstall_idle_handler(9)cpuidle_pause_and_lock(9)cpuidle_resume_and_unlock(9)cpuidle_enable_device(9)cpuidle_disable_device(9)__cpuidle_register_device(9)cpuidle_register_device(9)cpuidle_unregister_device(9)cpuidle_unregister(9)cpuidle_register(9)cpuidle_init(9)
ok and a lil sign-off fr fr: this whole page lives over in./drivers/cpuidle, dated October 2026, and it'scpuidle_select(9)bestie β stan her, cite her, don't return negative from her πβ¨
π¦ 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