lscpu命令是在Linux系统中用于显示和收集有关CPU(中央处理器)架构和相关信息的命令。它提供了关于CPU的详细信息,包括处理器类型、架构、核心数、线程数、缓存大小等。使用lscpu命令,你可以获取以下信息:

1. 架构信息:显示CPU的架构,例如x86、x86_64、ARM等。
2. CPU模式:指示CPU的运行模式,例如32位或64位。
3. CPU频率:显示CPU的时钟频率,即CPU的运行速度。
4. CPU核心数:显示CPU的物理核心数,即处理器芯片上的实际核心数量。
5. 线程数:显示CPU的线程数,包括物理核心和超线程(如果支持)的逻辑核心。
6. 缓存大小:显示CPU的缓存大小,包括L1、L2和L3缓存。

 

名词解释:

Socket :具体是指的主板上 CPU 的插槽数量,一般笔记本只有一个,而服务器可能会有多个。如果有两个插槽,通常称为两路

Core :   具体是指 CPU 的核心,也就是平常说的几核,比如八核之类

thread :是指的每个 Core 的硬件线程数,超线程

总核数 = 物理CPU个数  X  每颗物理CPU的核数
总逻辑CPU数 = 物理CPU个数  X  每个物理CPU的核数  X  每个核心线程数

 


比如下面我的台式机,1 Sockets, 4 Cores,2 Threads,那么就是 4 核 8 线程。

如下示例:

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                8
On-line CPU(s) list:   0-7
Thread(s) per core:    2
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1

 

 

lscpu:

[root@localhost ~]# lscpu
Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    2
Core(s) per socket:    2
座:                   1
NUMA 节点:            1
厂商 ID:              GenuineIntel
CPU 系列:             6
型号:                 58
型号名称:             Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz
步进:                 9
CPU MHz:              1211.718
CPU max MHz:           2400.0000
CPU min MHz:           1200.0000
BogoMIPS:             4789.11
虚拟化:               VT-x
L1d 缓存:             32K
L1i 缓存:             32K
L2 缓存:              256K
L3 缓存:              3072K
NUMA 节点0 CPU:       0-3
Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic popcnt tsc_deadline_timer xsave avx f16c lahf_lm epb ssbd rsb_ctxsw ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase smep erms xsaveopt dtherm arat pln pts md_clear spec_ctrl intel_stibp flush_l1d

根据上面的输出示例,以下是对每个字段的详细介绍:

1. Architecture: x86_64
   架构信息,表示系统的CPU架构为x86_64,即64位架构。

2. CPU op-mode(s): 32-bit, 64-bit
   CPU的运行模式,表示支持32位和64位运行模式。

3. Byte Order: Little Endian
   字节顺序,表示系统采用的字节序为小端序。

4. CPU(s): 4
   CPU的数量,表示系统中有4个CPU。

5. On-line CPU(s) list: 0-3
   在线CPU列表,表示CPU编号为0到3的CPU处于在线状态。

6. Thread(s) per core: 2
   每个核心的线程数,表示每个物理核心支持2个线程。

7. Core(s) per socket: 2
   每个插槽的核心数,表示每个CPU插槽中有2个物理核心。

8. Socket(s): 1
   插槽数量,表示系统中有1个CPU插槽。

9. NUMA node(s): 1
   NUMA节点数,表示系统中有1个NUMA节点。

10. Vendor ID: GenuineIntel
    厂商ID,表示CPU的制造商为GenuineIntel。

11. CPU family: 6
    CPU系列,表示CPU所属的系列为6。

12. Model: 58
    型号,表示CPU的型号为58。

13. Model name: Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz
    型号名称,表示CPU的具体型号为Intel(R) Core(TM) i3-3110M CPU @ 2.40GHz。

14. Stepping: 9
    步进,表示CPU的步进号为9。

15. CPU MHz: 1211.718
    CPU的频率,表示CPU的运行频率为1211.718 MHz。

16. CPU max MHz: 2400.0000
    CPU的最大频率,表示CPU的最高运行频率为2400.0000 MHz。

17. CPU min MHz: 1200.0000
    CPU的最小频率,表示CPU的最低运行频率为1200.0000 MHz。

18. BogoMIPS: 4789.11
    BogoMIPS值,表示CPU的性能指标。

19. Virtualization: VT-x
    虚拟化支持,表示CPU支持VT-x虚拟化技术。

20. L1d cache: 32K
    L1数据缓存大小,表示CPU的一级数据缓存大小为32KB。

21. L1i cache: 32K
    L1指令缓存大小,表示CPU的一级指令缓存大小为32KB。

22. L2 cache: 256K
    L2缓存大小,表示CPU的二级缓存大小为256KB。

23. L3 cache: 3072K
    L3缓存大小,表示CPU的三级缓存大小为3072KB。

24. NUMA node0 CPU(s): 0-3
    NUMA节点0上的CPU列表,表示NUMA节点0上有编号为0到3的CPU。

25. Flags: ...
    标志位,表示CPU支持的特性和功能的列表。这是一个非常长的字段,包含了各种CPU的特性和扩展指令集。

 

flags参数:
yao@linx40:~$ sudo /sbin/dmidecode -t processor
[sudo] yao 的密码:
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 3.4.0 present.
# SMBIOS implementations newer than version 3.2.0 are not
# fully supported by this version of dmidecode.

Handle 0x0046, DMI type 4, 48 bytes
Processor Information
        Socket Designation: U3E1
        Type: Central Processor
        Family: Core i5
        Manufacturer: Intel(R) Corporation
        ID: 75 06 09 00 FF FB EB BF
        Signature: Type 0, Family 6, Model 151, Stepping 5
        Flags:
                FPU (Floating-point unit on-chip)
                VME (Virtual mode extension)
                DE (Debugging extension)
                PSE (Page size extension)
                TSC (Time stamp counter)
                MSR (Model specific registers)
                PAE (Physical address extension)
                MCE (Machine check exception)
                CX8 (CMPXCHG8 instruction supported)
                APIC (On-chip APIC hardware supported)
                SEP (Fast system call)
                MTRR (Memory type range registers)
                PGE (Page global enable)
                MCA (Machine check architecture)
                CMOV (Conditional move instruction supported)
                PAT (Page attribute table)
                PSE-36 (36-bit page size extension)
                CLFSH (CLFLUSH instruction supported)
                DS (Debug store)
                ACPI (ACPI supported)
                MMX (MMX technology supported)
                FXSR (FXSAVE and FXSTOR instructions supported)
                SSE (Streaming SIMD extensions)
                SSE2 (Streaming SIMD extensions 2)
                SS (Self-snoop)
                HTT (Multi-threading)
                TM (Thermal monitor supported)
                PBE (Pending break enabled)
        Version: 12th Gen Intel(R) Core(TM) i5-12500
        Voltage: 1.1 V
        External Clock: 100 MHz
        Max Speed: 4600 MHz
        Current Speed: 4059 MHz
        Status: Populated, Enabled
        Upgrade: Other
        L1 Cache Handle: 0x0043
        L2 Cache Handle: 0x0044
        L3 Cache Handle: 0x0045
        Serial Number:
        Asset Tag:
        Part Number:
        Core Count: 6
        Core Enabled: 6
        Thread Count: 12
        Characteristics:
                64-bit capable
                Multi-Core
                Hardware Thread
                Execute Protection
                Enhanced Virtualization
                Power/Performance Control

yao@linx40:~$

 

posted on 2024-04-29 10:21  天外来客I  阅读(64)  评论(0编辑  收藏  举报