stop_machine...inactive_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… stop_machine_from_inactive_cpu β€” Kernel API Manual, bestie edition πŸŽ€

okay so we're in the Kernel API Manual today and the star of the show is stop_machine...inactive_cpu(9) ✨ she's a little niche but she's so good at her job, i promise.


✨ NAME ✨

stop_machine_from_inactive_cpu β€” literally just stop_machine() but called from an inactive CPU 🫢


🌸 SYNOPSIS 🌸

int stop_machine_from_inactive_cpu (cpu_stop_fn_t fn , void *data ,
       const struct cpumask *cpus );

like yes bestie that's the whole signature, no cap πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • fn β€” the function you wanna run. the main character, fr.
  • data β€” the data ptr for the fn. she's the plus-one πŸŽ€
  • cpus β€” the cpus to run the fn on (NULL = any online cpu) ✨

πŸ’– DESCRIPTION πŸ’–

so this is identical to stop_machine β€” same energy, same vibes β€” but the whole point is you can call it from a CPU which is not active. iconic behaviour honestly.

the local CPU is in the process of hotplug (which means no other CPU hotplug can start, so don't even worry about it 🫢), and it's not marked active, and it doesn't have enough context to sleep. poor thing is exhausted.

this function provides stop_machine functionality for such a state by using a busy-wait for synchronization and executing fn directly for the local CPU πŸ’€ no sleeping on the job here, she's spinning and she's thriving.


πŸ”₯ CONTEXT πŸ”₯

Local CPU is inactive. Temporarily stops all active CPUs. that's it, that's the vibe. dramatic but efficient πŸ’…


⭐ RETURN ⭐

  • 0 if all executions of fn returned 0 β€” slay, everything ate πŸ”₯
  • any non zero return value if any returned non zero β€” not everything can be a winner, and that's okay 😭

🌈 SEE ALSO 🌈

Kernel file ./kernel/stop_machine.c β€” go read the source, iykyk πŸ‘‘

the whole friend group honestly, go say hi 🌸


okay bye bestie, this page is from ./kernel, October 2026, and it's the stop_machine...inactive_cpu(9) entry in the Kernel API Manual β€” go stop some machines, but like, responsibly πŸ§šπŸ’œ

πŸ“¦ where this page comes from