stop_cpus(9)
stop_cpus(9) π
okay bestie, welcome to the Kernel API Manual page for stop_cpus β yes, the function name is literally right there, we move fast around here π
πΈ NAME πΈ
stop_cpus β stop multiple cpus π
β¨ SYNOPSIS β¨
int stop_cpus (const struct cpumask *cpumask , cpu_stop_fn_t fn , void
*arg );
π ARGUMENTS π
cpumaskβ cpus to stop πfnβ function to execute β¨argβ argument tofnπ
π¦ DESCRIPTION π¦
Execute fn(arg) on online cpus in cpumask. On each target cpu, fn is run in a process context with the highest priority preempting any task on the cpu and monopolizing it. This function returns after all executions are complete. π€
This function doesn't guarantee the cpus in cpumask stay online till fn completes. If some cpus go down in the middle, execution on the cpu may happen partially or fully on different cpus. fn should either be ready for that or the caller should ensure that the cpus stay online until this function completes. β οΈ
All stop_cpus calls are serialized making it safe for fn to wait for all cpus to start executing it. π
π€ CONTEXT π€
Might sleep. π΄
β RETURN β
-ENOENTiffn(arg)was not executed at all because all cpus incpumaskwere offline; otherwise,0if all executions offnreturned0, any non zero return value if any returned non zero. π
π SEE ALSO π
Kernel file ./kernel/stop_machine.c β go check out stop_one_cpu(9), stop_two_cpus(9), stop_one_cpu_nowait(9), and stop_machine_from_inactive_cpu(9). π«Ά
π«Ά that's the whole page, bestie β straight from the ./kernel source, dated October 2026, and it's stop_cpus(9) all the way down. π
π¦ 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