cpuidle_coupled_set_done(9)
π cpuidle_coupled_set_done(9) β bestie's edition
okay so this is a page from the Kernel API Manual, and it's about one tiny but very important little function. sit down, hydrate, and let's get into it π«Ά
β¨ NAME β¨
cpuidle_coupled_set_done β marks this cpu as officially leaving the ready loop, bye bye, no notes π
πΈ SYNOPSIS πΈ
void cpuidle_coupled_set_done (int cpu , struct cpuidle_coupled *coupled
);
like yeah that's the whole signature, she's short but she's doing a LOT β¨
π ARGUMENTS π
cpuβ the current cpu. that's the one we're marking as done, aka the main character of this call πcoupledβ thestruct coupledthat contains the current cpu. she's the group chat this cpu is in π«Ά
π¦ DESCRIPTION π¦
so what does she actually do? she marks this cpu as no longer in the ready and waiting loops. like, this cpu has left the building, the vibe check is over, she's out π
and here's the iconic part: it decrements the waiting count first to prevent another cpu looping back in and seeing this cpu as waiting just before it exits idle. the way that ordering matters ππ₯ it's giving careful, it's giving responsible, it's giving correct concurrency behaviour π
ngl, the ordering of that decrement is not optional β get it wrong and another cpu could see this one as still waiting right when it's about to leave idle. do not skip ahead, bestie π
π₯ SEE ALSO π₯
- kernel file
./drivers/cpuidle/coupled.c(go read her, she's the source fr fr) 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_clear_pokes(9)cpuidle_enter_state_coupled(9)cpuidle_coupled_register_device(9)cpuidle_coupled_unregister_device(9)cpuidle_coupled_prevent_idle(9)cpuidle_coupled_allow_idle(9)
literally the whole coupled cpuidle friend group, iykyk π
and that's the page!! this one lives in ./drivers/cpuidle and it's dated October 2026, so mark your calendar bestie πβ¨ bye bye, go set some cpus done π
π¦ 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