smp_call_function_many(9)
π smp_call_function_many(9) π
Kernel API Manual realness, bestie β¨ β this is the page for smp_call_function_many(9), and yes, it's giving βrun your function on a whole set of CPUsβ energy.
πΈ NAME πΈ
smp_call_function_many β run a function on a set of CPUs.
β¨ SYNOPSIS β¨
void smp_call_function_many (const struct cpumask *mask ,
smp_call_func_t func , void *info , bool wait );
π ARGUMENTS π
maskβ the set of CPUs to run on. Only runs on the online subset, so offline CPUs are literally not invited to this party.funcβ the function to run. This must be fast and non-blocking. No napping, no blocking, periodt.infoβ an arbitrary pointer to pass to the function. It's the little bag of info you're handing over.waitβ iftrue, wait (atomically) until the function has completed on other CPUs. Emphasis on atomically, bestie.
π DESCRIPTION π
Okay so first things first: you must not call this function with disabled interrupts or from a hardware interrupt handler or from a bottom half handler. Like, that's a hard no. Do not test the vibes there.
Also, func is not called on the local CPU even if mask contains it. So even if the local CPU is in the mask, it's not getting a callback from this one. If that's not what you want, consider using on_each_cpu_cond_mask instead.
π«Ά Bestie note: the βfast and non-blockingβ rule for func is not a suggestion. Keep it quick and do not block.
π SEE ALSO π
Kernel file: ./kernel/smp.c β and the whole reference squad is right here:
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(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)
Catch you in ./kernel β October 2026, bestie πβ¨
π¦ 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