STRUCT SMP_CALL_ON_CPU_STRUCT(9)
π struct smp_call_on_cpu_struct β NAME
ok so listen bestie: struct smp_call_on_cpu_struct is literally the whole vibe β it's the struct you use to Call a function on a specific CPU β¨ (yes that's the official job description, no cap).
this is from the Kernel API Manual, in case you were wondering where the lore comes from π
πΈ SYNOPSIS
struct smp_call_on_cpu_struct {
struct work_struct work;
struct completion done;
int (*func)(void *);
void *data;
int ret;
int cpu;
};
π¦ Members
workβ awork_struct, aka the little work item that carries this whole operation. it's giving "the actual doer" energy πdoneβ a completion to signal. this is your "we're so back" notification, the thing that tells everybody the call finished π«Άfuncβ function to call. the main character, fr fr β it takes avoid *and hands you back anintπdataβ the function's data argument. whatever lil payload you're passing along tofuncπretβ the return value fromfunc. whateverfuncdecided to give back gets parked right here π₯cpuβ the target CPU, and heads up:-1means any CPU, so pick that if you're feeling flexible β¨
π Description
ok so the tea β: this struct is used to call a function on a specific cpu and wait for it to return. like, you dispatch it, and then you sit there and wait, because patience is a virtue and also the whole design π₯
optionally, you can also make sure the call is done on a specified physical cpu via vcpu pinning β which is the move when you wanna support virtualized environments π§ no cap, that's the whole point of that part.
π SEE ALSO
Kernel file ./kernel/smp.c β and 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)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)smp_call_on_cpu(9)
and that's the whole page, bestie β go call a function on a CPU, you absolute icon π
sign-off era π: this one lives in ./kernel, stamped October 2026. periods, slay, mwah π
π¦ 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