smp_call_function_many(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 β€” if true, 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:


Catch you in ./kernel β€” October 2026, bestie πŸ’–βœ¨

πŸ“¦ where this page comes from