Re: Finding physical and logical core number in a kernel module ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> I agree that the kernel module is not restricted to any core but is it
> possible that whenever it is executed
> it gives the core number whichever is executing it ?

Have a look at the end of include/linux/smp.h: smp_processor_id()
gives you the number of the current executing CPU. get_cpu() will do
the same and will also disable preemption so that you will stay on
that CPU until put_cpu() is called.

>From user-space, you can use sched_getcpu() to obtain the same information.

Hope this helps,
Alex.

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux