stop_core_cpuslocked(9)
π stop_core_cpuslocked β kernel API manual, bestie edition π
okay so real talk, this is a page straight out of the Kernel API Manual, and honestly? it's a baddie. it does one thing and it does it slayfully. let's get into it β¨
β¨ NAME β¨
stop_core_cpuslocked β stop all threads on just one core π
like not the whole system, not every CPU, just one core. main character energy but make it hyper-localized π
πΈ SYNOPSIS πΈ
int stop_core_cpuslocked (unsigned int cpu , cpu_stop_fn_t fn , void *data );
yeah that's the whole signature, she's compact and she knows it π«Ά
π¦ ARGUMENTS π¦
cpuβ any cpu in the targeted core. literally any one of them, she'll figure out which core you mean, iykyk πfnβ the function to run on each CPU in the core containingcpu. this is the whole errand, the thing you actually came here to do β¨dataβ the data ptr to pass tofn. the little care package you hand over π
π₯ DESCRIPTION π₯
Same as above, but instead of every CPU, only the logical CPUs of the single core containing cpu are affected. π
(and yes, "same as above" β she's referencing her sister function, keep scrolling to SEE ALSO, it's giving sequel energy π)
π CONTEXT π
Must be called from within a cpus_read_lock protected region.
β οΈ bestie do NOT skip this. if you're not inside a cpus_read_lock protected region you are lowkey asking for chaos. it's not a vibe check you can fail, it's a rule π
β RETURN β
0β returned if all invocations offnreturn zero. everyone came back clean, we love a unanimous slay π- otherwise β the value returned by an arbitrarily chosen member of the set of calls to
fnthat returned non-zero. so like, one of the failures gets to speak for the group. arbitrary. chaotic. iconic. which one? don't ask, it's not telling π
π§ SEE ALSO π§
- Kernel file
./include/linux/stop_machine.h stop_machine(9)stop_machine_cpuslocked(9)
go read those next, they're the prequels and the lore runs deep π
okay that's the whole page, you're so welcome π remember: one core only, lock held, fn returns zero everywhere or you get somebody's random non-zero back.
from ./include/linux β October 2026 β with love, the Kernel API Manual crew πΈπ«Άβ¨
π¦ 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