2006-12-28 15:04:41

by Yu-Chen Wu

[permalink] [raw]
Subject: How to get the processor ID at run-time?

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




2006-12-28 15:19:39

by Gerb Stralko

[permalink] [raw]
Subject: Re: How to get the processor ID at run-time?

> 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