#Cat/proc/cpuinfo
Linux under
/proc/cpuinfo
The file will display information about the CPU
Processor will start counting from 0 and continue with multiple CPUs
Flags if HT description supports Hyper-Threading technology
To determine the number of physical CPUs, you can view the value of the physical ID, same as the same physical CPU
Processor:4
Vendor_id:genuineintel
CPU Family:15
Model:4
Model Name:intel (R) Xeon (TM) CPU 3.00GHz
Stepping:8
CPU mhz:3002.700
Cache size:2048 KB
Physical Id:9
Siblings:4
Core id:19
CPU Cores:2
------------------------------
Processor:5
Vendor_id:genuineintel
CPU Family:15
Model:4
Model Name:intel (R) Xeon (TM) CPU 3.00GHz
Stepping:8
CPU mhz:3002.700
Cache size:2048 KB
Physical Id:9
Siblings:4
Core id:19
CPU Cores:2
-----------------------------------------------
Address sizes:40 bits physical, bits virtual
Power Management:
Keywords: SMP Linux multi-CPU number Hyper-Threading HT hyper-threading
Excerpt some of the relevant knowledge on the Internet:
Hyper-Threading technology is to use special hardware instructions to simulate two logical cores into two physical chips, so that a single processor can use thread-level parallel computing, which is compatible with multi-threaded operating systems and software, reduce CPU idle time, improve the efficiency of the CPU.
With Hyper-threading in time, applications can use different parts of the chip at the same moment. Although a single threaded chip can handle thousands of instructions per second, only one instruction can be manipulated at any one time. and hyper-Threading technology can make the chip simultaneously multithreading, so that the chip performance is improved.
Hyper-Threading technology is a CPU at the same time to execute multiple programs to share a CPU resources, in theory, like two CPUs at the same time executing two threads, P4 processors need to add a logical CPU pointer (logical processing unit). So the die of the new generation of P4 HT is 5% larger than the previous P4. The rest, such as the ALU (integer unit of operation), FPU (floating-point unit), L2 cache (level two caching) remain unchanged, and these parts are shared.
Although using Hyper-Threading technology can execute two threads at the same time, it is not like two real CPUs, and each CPU has a separate resource. When two threads need a resource at the same time, one of them stops temporarily and yields resources until the resources are idle to continue. Therefore, the performance of Hyper-threading is not equal to the performance of two CPUs.
Intel P4 Hyper-Threading has two operating modes, single task mode and multi task modes (multitasking mode), when the program does not support multi-processing (multiprocessor jobs), the system will stop the operation of one of the logical CPUs, Focus resources on a single logical CPU, allowing single-threaded routines to not be idle by one of the logical CPUs, but because the logical CPUs that are stopped are still waiting to work, consuming a certain amount of resources, the Hyper-threading CPU runs the task mode, you may not be able to achieve CPU performance without Hyper-threading functionality, but the performance gap is not too great. That is, hyper-threading technology can even degrade system performance when running single-threaded software, especially when multithreaded operating systems run single-threaded software.