cpuidle_cou...et_not_ready(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct coupled that 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 0 if the counter was decremented successfully β€” slay, it worked ✨
  • returns -EINVAL if 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:


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