Linux to read the Processor model, physical cores, virtual cores and L1, L2 cache

来源:互联网 发布:微店和淘宝的付款方式 编辑:程序博客网 时间:2024/05/23 17:51

The information about the CPU of a Linux computer is stored in the file /proc/cpuinfo(cat /proc/cpuinfo)


It is a long file so that we need to use pipeline tool to process our information. 


In general, the information inside the cpuinfo is about the setting of each processor. Since the Intel company has the technique of hyper-thread. Therefore, the processor here is the virtual cores. 


About the actual cores is the number displayed in the row of cpu cores of each processor. 


The model name is also displayed in each processor. 


If the computer has two CPU, then we can distinguish them by the physical id. If the processors' physical id are the same, then they belong to one CPU.


The way to see the L1/ L2 cache is use command:


See which level is:


$ cat /sys/devices/system/cpu/cpu0/cache/index0/level
See the size:
cat /sys/devices/system/cpu/cpu0/cache/index0/size



0 0
原创粉丝点击