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

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



你可能感兴趣的:(linux,cpu,缓存)