CPU
socket表示CPU插槽,1个CPU插槽安装1个物理CPU
core表示核,1个物理CPU包含多个core
Thread表示线程(逻辑CPU),1个core包含1(关闭HT)或2(打开HT)个Thread
双路十六核表示2个物理CPU,1个物理CPU包含16个核,打开HT后一共包含2 * 16 * 2 = 64核,如下所示:
Socket 0 Socket 1
Core 0 [0, 32] [16, 48]
Core 1 [1, 33] [17, 49]
Core 2 [2, 34] [18, 50]
Core 3 [3, 35] [19, 51]
Core 4 [4, 36] [20, 52]
Core 5 [5, 37] [21, 53]
Core 6 [6, 38] [22, 54]
Core 7 [7, 39] [23, 55]
Core 8 [8, 40] [24, 56]
Core 9 [9, 41] [25, 57]
Core 10 [10, 42] [26, 58]
Core 11 [11, 43] [27, 59]
Core 12 [12, 44] [28, 60]
Core 13 [13, 45] [29, 61]
Core 14 [14, 46] [30, 62]
Core 15 [15, 47] [31, 63]
[root@localhost ~]# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 64 # 逻辑CPU数
On-line CPU(s) list: 0-63
Thread(s) per core: 2 # 每个core的Thread数
Core(s) per socket: 16 # 每个socket的core数
Socket(s): 2 # socket数
NUMA node(s): 2 # NUMA数
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
Stepping: 1
CPU MHz: 2500.000
CPU max MHz: 3000.0000
CPU min MHz: 1200.0000
BogoMIPS: 5000.00
Virtualization: VT-x
Hypervisor vendor: vertical
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 40960K
NUMA node0 CPU(s): 0-15,32-47 # NUMA0 逻辑CPU列表
NUMA node1 CPU(s): 16-31,48-63 # NUMA1 逻辑CPU列表
...
[root@localhost ~]# cat /proc/cpuinfo
processor : 0 # 逻辑CPU0
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
stepping : 1
microcode : 0xb000021
cpu MHz : 2500.000
cache size : 40960 KB
physical id : 0 # 物理CPU0
siblings : 32 # 每个物理CPU的逻辑CPU数
core id : 0 # core0
cpu cores : 16 # 每个物理CPU的core数
...
processor : 63 # 逻辑CPU63
vendor_id : GenuineIntel
cpu family : 6
model : 79
model name : Intel(R) Xeon(R) CPU E5-2682 v4 @ 2.50GHz
stepping : 1
microcode : 0xb000021
cpu MHz : 2500.000
cache size : 40960 KB
physical id : 1 # 物理CPU1
siblings : 32 # 每个物理CPU的逻辑CPU数
core id : 15 # core15
cpu cores : 16 # 每个物理CPU的core数
...
NUMA
NUMA(Non-Uniform Memory Access,非统一内存访问)
一般情况下,一个socket对应一个numa node,也可能一个socket对应多个numa node:
http://www.benjaminathawes.com/2011/11/09/determining-numa-node-boundaries-for-modern-cpus/
Today the unit of a NUMA node is usually one processor or socket. Means in most of the cases there is a 1:1 relationship between a NUMA node and a socket/processor. Exception is AMDs current 12-core processor which represents 2 NUMA nodes due to the processor’s internal architecture
[root@localhost ~]# grep -i numa /var/log/dmesg
[root@localhost ~]# numactl --hardware
[root@localhost ~]# numastat
[root@localhost ~]# ls /sys/devices/system/node/node0
[root@localhost ~]# ls /sys/devices/system/node/node0/hugepages
HT
HT(Hyper-Threading,超线程)