Cat/proc/cpuinfo-induced thinking--cpu physical encapsulation-physical core-logical core-hyper-threading relationships

Source: Internet
Author: User
Tags unique id

Physical encapsulation of the CPU, a physical package using a separate CPU physical slot, sharing power and fans;

CPU Physical Core: Encapsulates multiple independent CPU cores in a physical package, each with its own complete hardware unit.

CPU Logic Core: A CPU physical core external performance as a number of independent external CPU interface, called this each CPU interface as a logical core. It may share running units and caches internally.

CPU Logic core is the product of Hyper-Threading technology, assuming that there is no hyper-threading technology, how many physical CPU cores, the OS will feel how many CPUs. The OS is based on the external interface of the CPU to identify the CPU data, rather than the actual internal structure of the CPU. So hyper-Threading technology
will allow the OS to identify many other CPUs.

Each physical package can have multiple CPU cores, and each CPU physical core (Hyper-Threading technology) can have multiple logical cores, and the OS sees the total number of logical cores.

Hyper-Threading Technology, full name hyper-threading: Hyper-Threading technology is the use of special hardware instructions, the two logical core simulation into two physical chips, so that a single processor can use thread-level parallel computing, and thus compatible with multi-threaded operating systems and software, reducing the CPU idle time, Increased CPU Execution speed

Multi-core processors: each physical package encapsulates multiple CPU cores, each of which is a separate processor chip, in addition to being packaged together. Basic does not share other physical parts;
Hyper-Threading Technology: Just the external interface allows OS software to see the two core, the actual internal multiple internal logic core sharing: running units and caches. Its main purpose is the CPU and memory speed difference, the system bottleneck is not the CPU operating unit, and the external
Memory, through Hyper-threading technology, improve the efficiency of CPU use;


#############################################################
Cat/proc/cpuinfo Core parameter description for CPU:

The number of the physical package of the physical ID:CPU, encoded sequentially from 0;
Siblings: The number of logical cores on each physical package;
CPU Cores: The number of physical cores on each physical package.
Core ID: The current physical core number on the physical package
Processor: Logical CPU core number. from 0 start coding;


The above figures relate to:
siblings/(CPU Cores) = number of logical CPUs per CPU physical core, assuming that equals 1 does not have Hyper-threading, assuming that more than 1 has hyper-threading.
siblings* (max (physical ID) + 1) = number of machine all logical cores = MAX (processor) +1


Demo Sample:


Processor:23 #逻辑CPU编号23
Vendor_id:genuineintel
CPU Family:6
Model:45
Model Name:intel (R) Xeon (r) CPU e5-2620 0 @ 2.00GHz
Stepping:7
CPU mhz:1999.772
Cache size:15360 KB
Physical Id:1 #物理封装编号是1
Siblings:12 #每一个物理封装有12个逻辑核心 (CPU)
Core Id:5 #当前物理核心的在当前物理封装中的编号
CPU Cores:6 #每一个物理封装有6个物理核心 (CPU)


Core ID: The physical core number under the current physical package. The physical core is different under the same package, but the physical core can be the same under different physical packages;
However/proc/cpuinfo has a field named ' Core ID ' which are a unique ID for each core in a single processor


#lscpu Clearer:
[Email protected]/data1/andes/201507]# LSCPU
Architecture:x86_64 #64位架构
CPU Op-mode (s): 32-bit, 64-bit #支持32 64-bit
Byte Order:little Endian #小端
CPU (s): #逻辑核心12个
On-line CPU (s) list:0-11 #逻辑核心编号0-11
Thread (s) per Core:2 #每一个物理核心2个逻辑核心. Hyper-Threading
Core (s) per Socket:6 #每一个物理封装有6个物理核心
CPU socket (s): 1 #总共1个CPU槽位, supports a physical package
NUMA node (s): 1
Vendor Id:genuineintel
CPU Family:6
model:62
Stepping:4
CPU mhz:2100.059 #cpu频率2.1GHZ
bogomips:4199.88
Virtualization:vt-x
L1D cache:32k
L1i cache:32k
L2 cache:256k
L3 cache:15360k
NUMA node0 CPU (s): 0-11

#########################################################
#工具字典
1. View the number of physical packages:
Cat/proc/cpuinfo |grep "Physical id" |sort |uniq

2. View the number of logical cores:
Cat/proc/cpuinfo |grep "Processor"

3. Look at the number of physical cores in each physical package:
Cat/proc/cpuinfo |grep "CPU Cores"

4. View the number of logical CPUs under each physical package:
Cat/proc/cpuinfo |grep "siblings" |uniq


5. See if there are hyper-threading
Cat/proc/cpuinfo |grep "siblings" |uniq && cat/proc/cpuinfo |grep "CPU Cores" |uniq
Look at the relationship between the number of siblings and the number of CPU cores

6. The clearest display of CPU information LSCPU



Cat/proc/cpuinfo-induced thinking--cpu physical encapsulation-physical core-logical core-hyper-threading relationships

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.