stop_machine...inactive_cpu(9)
π
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 thefn. she's the plus-one πcpusβ the cpus to run thefnon (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 β
0if all executions offnreturned0β 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
- 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