smp_call_function(9)
π smp_call_function(9) β like, the Kernel API Manual, bestie β¨
okay so this is smp_call_function from the kernel API manual and honestly? it's kind of a baddie. it runs your function on all the other CPUs. no cap. π«Ά
β¨ NAME β¨
smp_call_function β run a function on all the other CPUs π
πΈ SYNOPSIS πΈ
void smp_call_function (smp_call_func_t func , void *info , int wait );
π ARGUMENTS π
funcβ the function you want to run. and like, it must be fast and non-blocking, okay? this is not the vibe for your long dramatic main-character computation πinfoβ literally just an arbitrary pointer that gets passed through to the function. do whatever with it, queen π¦waitβ if true, wait (atomically!) until the function has completed on the other CPUs. atomically is doing a lot of work in that sentence ngl π
π₯ DESCRIPTION π₯
So if wait is true, then it returns once func has returned. otherwise it returns just before the target cpu calls func β the way that timing works is so specific, iykyk β
big warning energy: you must not call this function with disabled interrupts, or from a hardware interrupt handler, or from a bottom half handler. like, don't. seriously. π
π SEE ALSO π
Kernel file ./kernel/smp.c and honestly the whole friend group:
csd_lock_is_stuck(9)generic_smp_call_function_single_interrupt(9)__flush_smp_call_function_queue(9)flush_smp_call_function_queue(9)smp_call_function_single(9)smp_call_function_single_async(9)smp_call_function_any(9)smp_call_function_many(9)on_each_cpu_cond_mask(9)kick_all_cpus_sync(9)wake_up_all_idle_cpus(9)cpus_peek_for_pending_ipi(9)struct smp_call_on_cpu_struct(9)smp_call_on_cpu(9)
okay that's the whole page, mwah π this one's from ./kernel, dated October 2026, and it's filed under smp_call_function(9) β slay, go forth and call your functions on all the other CPUs 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