smp_call_on_cpu(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… smp_call_on_cpu(9) β€” the Kernel API Manual, bestie edition πŸŽ€

Okay so picture this: you've got a function, right? And you've got one specific CPU in mind. And you're like "girl, I need this to run there and I need to wait for it." That's literally this whole thing. It's smp_call_on_cpu from the Kernel API Manual, and it's giving "call a function on a specific CPU and wait for it to return." Main character energy, no cap. ✨


🌸 NAME 🌸

smp_call_on_cpu β€” Call a function on a specific CPU and wait for it to return.


✨ SYNOPSIS ✨

int smp_call_on_cpu (unsigned int cpu , int (*func)(void *) , void *par
, bool phys );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • cpu β€” The CPU to run on. That's the whole vibe check: which CPU you're targeting. πŸ‘‘
  • func β€” The function to run. The actual star of the show. πŸ’…
  • par β€” An arbitrary pointer parameter for func. Like, whatever pointer you want to hand it β€” it's arbitrary, it's yours, it's giving "pass it through." 🫢
  • phys β€” If true, force to run on physical cpu. See struct smp_call_on_cpu_struct for more info. So like, true = physical CPU, periodt. 🌈

πŸ’€ RETURN πŸ’€

-ENXIO if the cpu is invalid; otherwise the return value from func.

So if the CPU you picked is a no-go, you get -ENXIO back (rough). Otherwise you get whatever func decided to give you β€” literally just passing it through. 😭

Not me calling out that "otherwise" β€” yeah, the success path is just func's own return value. That's it. That's the whole deal. πŸ™ˆ

🧚 SEE ALSO 🧚

Kernel file ./kernel/smp.c πŸ’– and these iconic neighbors:


πŸ’– that's the page, bestie πŸ’–

Sign-off time πŸŽ€: this one lives in ./kernel, dated October 2026, and it's page smp_call_on_cpu(9) of the Kernel API Manual. Go run your function on a CPU and slay. πŸ’œπŸŒΈπŸ¦‹

πŸ“¦ where this page comes from