cpuidle_coupled_set_done(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct coupled that 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 πŸ”₯

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