on_each_cpu_mask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

Okay bestie, buckle up πŸŽ€ β€” this is the on_each_cpu_mask(9) page from the Kernel API Manual, and it's literally about running a function on processors specified by cpumask, which may include the local processor. πŸ‘€πŸ’…


🌸 NAME 🌸

  • on_each_cpu_mask β€” run a function on processors specified by cpumask, which may include the local processor. ✨

✨ SYNOPSIS ✨

void on_each_cpu_mask (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). 🫢
  • func β€” the function to run. This must be fast and non-blocking, no cap. ⚑
  • info β€” an arbitrary pointer to pass to the function. literally whatever pointer you need to hand over. πŸŽ€
  • wait β€” if true, wait (atomically) until the function has completed on other CPUs. πŸ’«

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so here's the tea: if wait is true, then it returns once func has returned. Periodt. πŸ’…

🚨 Warning bestie: you must not call this function with disabled interrupts, or from a hardware interrupt handler, or from a bottom half handler. That's a hard no β€” those vibes do not mix. 😭

The one exception is iconic: it may be used during early boot while early_boot_irqs_disabled is set. πŸ‘‘βœ¨

πŸ”₯ SEE ALSO πŸ”₯

xoxo, your kernel bestie πŸ’‹ β€” this page lives in ./include/linux, is dated October 2026, and goes by on_each_cpu_mask(9). 🫢✨

πŸ“¦ where this page comes from