cpuidle_enter(9)
π€ cpuidle_enter(9) β from the Kernel API Manual, bestie π€
okay so real talk, this is the function that literally puts your CPU to sleep π΄ and honestly? iconic. it's cpuidle_enter, straight out of the Kernel API Manual, and we're gonna get into it.
β¨ NAME β¨
cpuidle_enter β the moment your CPU goes "aight imma head out" and enters the specified idle state π
π¦ SYNOPSIS π¦
int cpuidle_enter (struct cpuidle_driver *drv , struct cpuidle_device *dev , int index );
that's the whole signature, no cap. three args, one int coming back at you π
π ARGUMENTS π
drvβ the cpuidle driver that's tied with the cpu π«Ά like, this is the driver for this specific CPU, they're bonded, it's giving soulmate energy.devβ the cpuidle device πΈ your actual device struct, the main character of this whole operation.indexβ the index in the idle state table π which nap are we picking from the menu, bestie? that's the number.
π DESCRIPTION π
so what does it do? it returns the index in the idle state β like, the same index vibe comes back at you as the return value π«
and if things go wrong? it returns < 0 π yep, anything negative means error, and the specific error code depends on the backend driver β so like, don't come for cpuidle_enter, go ask the backend, it's the one holding the receipts π
π SEE ALSO π
the kernel file in question is ./drivers/cpuidle/cpuidle.c π β and here's the whole friend group, all of them (9) sections, all of them part of the lore:
cpuidle_play_dead(9)cpuidle_use_deepest_state(9)cpuidle_find_deepest_state(9)cpuidle_enter_s2idle(9)cpuidle_enter_state(9)cpuidle_select(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)
(fr fr, that's every single one, I did not skip a single icon π)
β οΈ friendly reminder bestie: an error is anything < 0, and which error you get is entirely up to the backend driver β do not assume, do not guess, read your backend. periodt.
and that's the page!! π source is ./drivers/cpuidle, dated October 2026, and the whole thing lives under cpuidle_enter(9) β mwah, go put that CPU to bed πβ¨π¦
π¦ 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