cpuidle_cou...et_not_ready(9)
π cpuidle_cou...et_not_ready(9) β from the Kernel API Manual, bestie
okay so picture this: we're in <pink>Kernel API Manual</pink> territory, section 9, and the page is literally called cpuidle_cou...et_not_ready. yes the name is truncated, no i will not be fixing it, that's just how it's printed. π
β¨ NAME β¨
cpuidle_coupled_set_not_ready β the function that marks a cpu as not ready. that's it. that's the whole vibe check. π
πΈ SYNOPSIS πΈ
int cpuidle_coupled_set_not_ready (struct cpuidle_coupled *coupled );
like, one struct in, one int out. lowkey elegant. π¦
π§ ARGUMENTS π§
coupledβ thestruct coupledthat contains the current cpu. that's your girl. that's the one you're passing in. π«Ά
π₯ DESCRIPTION π₯
okay so here's the tea β β this function decrements the ready counter, unless the ready counter (and therefore the waiting counter too, they're linked like that) is equal to the number of online cpus. and that "unless" is doing SO much work, let me tell you why.
it's preventing a race. and not a cute fun race, an actual cursed one. the scenario is: one cpu decrements the waiting counter and then re-increments it juuust before another cpu has decremented its ready counter. π and that little timing oopsie would make the ready counter go down from the number of online cpus without ever going through the coupled idle state. which is, like, the whole entire point. so. yeah. not great. this function says "not today." π
so the returns:
- returns
0if the counter was decremented successfully β slay, it worked β¨ - returns
-EINVALif the ready counter was equal to the number of online cpus β nope, blocked, not doing it π
fr fr, don't ignore that -EINVAL. it's not an error so much as a "bestie i'm protecting you" signal. π
π SEE ALSO π
the kernel file ./drivers/cpuidle/coupled.c, plus the whole friend group:
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_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_enter_state_coupled(9)cpuidle_coupled_register_device(9)cpuidle_coupled_unregister_device(9)cpuidle_coupled_prevent_idle(9)cpuidle_coupled_allow_idle(9)
and that's the page!! β¨ it lives over in ./drivers/cpuidle, it's dated <yellow>October 2026</yellow>, and it's brought to you by the <pink>Kernel API Manual</pink>. mwah. go read the other coupled functions, iykyk. πππ¦
π¦ 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