stop_machine_cpuslocked(9)
π stop_machine_cpuslocked(9) π
okay so this is straight out of the Kernel API Manual, and bestie, it's a good one β it's giving "stop the world" but make it kernel β¨
πΈ NAME πΈ
stop_machine_cpuslocked β freeze the machine on all CPUs and run this function π§π₯
like, all of them. every CPU. nobody moves until the function does its thing. main character function energy fr fr.
π SYNOPSIS π
int stop_machine_cpuslocked (cpu_stop_fn_t fn , void *data , const
struct cpumask *cpus );
π¦ ARGUMENTS π¦
fnβ the function to run π« like, this is the whole point, the star of the showdataβ the data ptr to pass tofnπ (a little gift for your function, we love that)cpusβ the cpus to runfnon (NULL= one unspecified online CPU) π note thatNULLis a real option here, and it means one unspecified online CPU, not all of them, not zero β one, and unspecified
π§ DESCRIPTION π§
Same as above. No cap, that's the whole thing β the manpage literally says "Same as above" π iykyk.
Also: avoids nested calls to cpus_read_lock. That's the lock part of the name, and it's the whole reason this variant exists β nested cpus_read_lock calls? not today, bestie π
ββοΈ
π CONTEXT π
Must be called from within a cpus_read_lock protected region. π
not optional, not a suggestion, not a vibe β it's a must. call it outside that region and you're not slaying, you're just wrong π
π SEE ALSO π
- Kernel file
./include/linux/stop_machine.h stop_machine(9)stop_core_cpuslocked(9)
that's the whole thing, bestie β you ate that π«Ά source is ./include/linux, version date October 2026, and the page signs off as stop_machine_cpuslocked(9). periodt. πβ
π¦ 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