cpuidle_enter_state_coupled(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” the struct cpuidle_device for the current cpu. it's giving "this is my cpu and only my cpu" energy πŸ’…
  • drv β€” the struct cpuidle_driver for the platform. the whole platform's vibe, not just yours ✨
  • next_state β€” the index of the requested state in drv->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 πŸ’œ

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