smp_processor_id(9)
π NAME π
okay so bestie, welcome to the smp_processor_id(9) manual page from the Kernel API Manual β¨ β it's literally about getting the current (stable) CPU id, and it's kind of iconic.
π SYNOPSIS π
smp_processor_id
π¦ DESCRIPTION π¦
This is the normal accessor to the CPU id, and you should use it whenever possible β no cap, it's the default bestie behavior π.
The CPU id is stable when:
- IRQs are disabled;
- preemption is disabled;
- the task is CPU affine.
ngl, whenCONFIG_DEBUG_PREEMPT=y, we verify these assumptions and hit you with aWARNwhensmp_processor_idis used while the CPU id is not stable. so if that warning pops up, don't act surprised π.
π SEE ALSO π
- Kernel file
./include/linux/smp.h on_each_cpu_mask(9)
kisses from the smp_processor_id(9) girlies β source/version: ./include/linux, date: October 2026 π«Άππβ¨
π¦ 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