cpuidle_enter_state_coupled(9)
π cpuidle_enter_state_coupled(9) β the Kernel API Manual, bestie edition π
okay so this is a page from the Kernel API Manual, and it's about cpuidle_enter_state_coupled β the function that gets your coupled cpus to actually agree on a nap time π€β¨ no cap, group projects but make it silicon.
β¨ NAME β¨
cpuidle_enter_state_coupled β attempt to enter a state with coupled cpus π«Ά
πΈ SYNOPSIS πΈ
int cpuidle_enter_state_coupled (struct cpuidle_device *dev , struct
cpuidle_driver *drv , int next_state );
π¦ ARGUMENTS π¦
devβ thestruct cpuidle_devicefor the current cpu. it's giving "this is my cpu and only my cpu" energy πdrvβ thestruct cpuidle_driverfor the platform. the whole platform's vibe, not just yours β¨next_stateβ the index of the requested state indrv->states. this is the exact slot in the list we're trying to slide into π
π DESCRIPTION π
so here's the whole thing, and honestly? it's a two-stage process, which is lowkey iconic π₯
Coordinate with coupled cpus to enter the target state. That's the mission, that's the whole girlboss assignment. π
stage one: the cpus are all operating independently, and they may call into cpuidle_enter_state_coupled at completely different times. nobody's on the same schedule, it's chaos, it's a group chat where everyone replies three hours apart π
the power-saving move: the first cpus to call this function will go to an intermediate state β the cpuidle_device's safe state β and wait for all the other cpus to call this function. they're not being dramatic, they're just waiting for the rest of the squad to show up π§
stage two: once all coupled cpus are idle, the second stage starts. Each coupled cpu will spin until all cpus have guaranteed that they will call the target_state. literally spinning until everyone pinky-promises π€β¨
β οΈ IMPORTANT, FOR REAL: This function must be called with interrupts disabled. It may enable interrupts while preparing for idle, and it will always return with interrupts enabled. so you go in with them off, and you come out with them ON. do not forget, i am begging π
π SEE ALSO π
- Kernel file
./drivers/cpuidle/coupled.cβ go read the source bestie, it's all in there π Coupled cpuidle states(9)struct cpuidle_coupled(9)cpuidle_coupled_parallel_barrier(9)cpuidle_state_is_coupled(9)cpuidle_coupled_state_verify(9)cpuidle_coupled_set_ready(9)cpuidle_coupled_set_not_ready(9)cpuidle_coupled_no_cpus_ready(9)cpuidle_coupled_cpus_ready(9)cpuidle_coupled_cpus_waiting(9)cpuidle_coupled_no_cpus_waiting(9)cpuidle_coupled_get_state(9)cpuidle_coupled_poke(9)cpuidle_coupled_poke_others(9)cpuidle_coupled_set_waiting(9)cpuidle_coupled_set_not_waiting(9)cpuidle_coupled_set_done(9)cpuidle_coupled_clear_pokes(9)cpuidle_coupled_register_device(9)cpuidle_coupled_unregister_device(9)cpuidle_coupled_prevent_idle(9)cpuidle_coupled_allow_idle(9)
like, that's the whole friend group right there, they all come as a set ππ
and that's the page! π
this lil gem lives in ./drivers/cpuidle, it's dated October 2026, and yes, cpuidle_enter_state_coupled(9) is the name on the door bestie β now go put those interrupt flags back the way you found them ππ«Άβ¨
π¦ 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