Are there kernel functions in Linux that would return the number of the physical core and logical core (in case of Hyperthreading) on which a kernel module is running ?
相关问题
- Kernel oops Oops: 80000005 on arm embedded system
- Linux kernel behaviour on heap overrun or stack ov
- Where is the standard kernel libraries to let kern
- What is the difference between /dev/mem, /dev/kmem
- Conditional compilation based on functionality in
相关文章
- Enable dynamic debug for multiple files at boot
- Difference in ABI between x86_64 Linux functions a
- Why are there no debug symbols in my vmlinux when
- ccflag option in Makefile
- A HR timers precision study case
- How can the linux bottom halfs execute in interrup
- Using wait_event_interruptible and wake_up_all tog
- Interrupt handling on an SMP ARM system with a GIC
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 untilput_cpu()
is called.From user-space, you can use
sched_getcpu()
orgetcpu()
to obtain the same information.