smp_processor_id(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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, when CONFIG_DEBUG_PREEMPT=y, we verify these assumptions and hit you with a WARN when smp_processor_id is used while the CPU id is not stable. so if that warning pops up, don't act surprised πŸ’€.

🌈 SEE ALSO 🌈


kisses from the smp_processor_id(9) girlies β€” source/version: ./include/linux, date: October 2026 πŸ«ΆπŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from