每个能够同时多线程处理的物理内核的线程作为独立的处理单元呈现给操作系统。 因此,具有两个执行线程的物理核心被操作系统视为两个(逻辑)核心。
each thread of execution of a physical core capable of simultaneous multithreading is presented to the operational system as an independent processing unit. Therefore, a physical core with two threads of execution is seen by the operational system as two (logical) cores.
lscpu显示了许多关于系统CPU架构的重要信息:
[faas-master@fmx217 ~]$ lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Gold 6140 CPU @ 2.30GHz
Stepping: 4
CPU MHz: 999.932
CPU max MHz: 3700.0000
CPU min MHz: 1000.0000
BogoMIPS: 4600.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 25344K
NUMA node0 CPU(s): 0-17,36-53
NUMA node1 CPU(s): 18-35,54-71
Flags: ...
显示每个CPU和cache之间的关系:
[faas-master@fmx217 ~]$ lscpu -p
# The following is the parsable format, which can be fed to other
# programs. Each different item in every column has an unique ID
# starting from zero.
# CPU,Core,Socket,Node,,L1d,L1i,L2,L3
0,0,0,0,,0,0,0,0
1,1,0,0,,1,1,1,0
2,2,0,0,,2,2,2,0
3,3,0,0,,3,3,3,0
4,4,0,0,,4,4,4,0
5,5,0,0,,5,5,5,0
6,6,0,0,,6,6,6,0
7,7,0,0,,7,7,7,0
8,8,0,0,,8,8,8,0
9,9,0,0,,9,9,9,0
10,10,0,0,,10,10,10,0
11,11,0,0,,11,11,11,0
12,12,0,0,,12,12,12,0
13,13,0,0,,13,13,13,0
14,14,0,0,,14,14,14,0
15,15,0,0,,15,15,15,0
16,16,0,0,,16,16,16,0
17,17,0,0,,17,17,17,0
18,18,1,1,,18,18,18,1
19,19,1,1,,19,19,19,1
20,20,1,1,,20,20,20,1
21,21,1,1,,21,21,21,1
22,22,1,1,,22,22,22,1
23,23,1,1,,23,23,23,1
24,24,1,1,,24,24,24,1
25,25,1,1,,25,25,25,1
26,26,1,1,,26,26,26,1
27,27,1,1,,27,27,27,1
28,28,1,1,,28,28,28,1
29,29,1,1,,29,29,29,1
30,30,1,1,,30,30,30,1
31,31,1,1,,31,31,31,1
32,32,1,1,,32,32,32,1
33,33,1,1,,33,33,33,1
34,34,1,1,,34,34,34,1
35,35,1,1,,35,35,35,1
36,0,0,0,,0,0,0,0
37,1,0,0,,1,1,1,0
38,2,0,0,,2,2,2,0
39,3,0,0,,3,3,3,0
40,4,0,0,,4,4,4,0
41,5,0,0,,5,5,5,0
42,6,0,0,,6,6,6,0
43,7,0,0,,7,7,7,0
44,8,0,0,,8,8,8,0
45,9,0,0,,9,9,9,0
46,10,0,0,,10,10,10,0
47,11,0,0,,11,11,11,0
48,12,0,0,,12,12,12,0
49,13,0,0,,13,13,13,0
50,14,0,0,,14,14,14,0
51,15,0,0,,15,15,15,0
52,16,0,0,,16,16,16,0
53,17,0,0,,17,17,17,0
54,18,1,1,,18,18,18,1
55,19,1,1,,19,19,19,1
56,20,1,1,,20,20,20,1
57,21,1,1,,21,21,21,1
58,22,1,1,,22,22,22,1
59,23,1,1,,23,23,23,1
60,24,1,1,,24,24,24,1
61,25,1,1,,25,25,25,1
62,26,1,1,,26,26,26,1
63,27,1,1,,27,27,27,1
64,28,1,1,,28,28,28,1
65,29,1,1,,29,29,29,1
66,30,1,1,,30,30,30,1
67,31,1,1,,31,31,31,1
68,32,1,1,,32,32,32,1
69,33,1,1,,33,33,33,1
70,34,1,1,,34,34,34,1
71,35,1,1,,35,35,35,1
lscpu -p | grep -v ^#
lscpu -p=cpu,node | grep -v ^#
大致的图形化表示如下:L1d (L1 data cache), L1i (L1 instruction cache), L3 cache is LLC.