How to distinguish physical processor cores from virtual

I will give an example of how to distinguish between physical and virtual processor cores in Linux.

Let’s see what kind of processors, number of cores, numaNode:

lscpu -p
lscpu | grep -i numa
cat /proc/cpuinfo
cat /proc/cpuinfo | grep "physical id"
cat /sys/devices/system/cpu/cpu0/topology/core_siblings_list
cat /sys/devices/system/cpu/*/topology/core_siblings_list
numactl --hardware

Now we define the physical and virtual kernels (the first physical, separated by a comma virtual kernel):

cat /sys/devices/system/cpu/cpu0/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu1/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu2/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu3/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu4/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu5/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu6/topology/thread_siblings_list
cat /sys/devices/system/cpu/cpu7/topology/thread_siblings_list

See also my articles:
Changing the processor core frequency in Linux
Check hardware information on Linux
Configuring the Network in Linux

Leave a comment

Leave a Reply