Skip to contentSkip to conversation

How to get the processor ID at run-time?

DISCUSSION Yu-Chen Wu 2 participants 2 messages Dec 28, 2006

lore
Share & tools
lore

Yu-Chen Wu

author
#0 lore raw

Hi all,
I am writing a kernel module that creates a kernel thread on a SMP
platform.
How to get the ID of the processor the kernel thread run on? Have any
kernel API? THX
Raymond

#1 lore raw
Quoted 5 lines

I am writing a kernel module that creates a kernel thread on a SMP
platform.
How to get the ID of the processor the kernel thread run on? Have any
kernel API? THX
Raymond

try smp_processor_id() it returns an unsigned int.

Thanks,

jerry