查看CPU信息

[root@tenor ~]# cat /proc/cpuinfo
processor : 0 # 系统中逻辑处理荷的编号
vendor_id : GenuineIntel # CPU制造商
cpu family : 6 #CPU产品系列代号
model : 94 #CPU属于其系列中的哪一代的代号
model name : Intel(R) Xeon(R) Gold 6148 CPU @ 2.40GHz #CPU属于的名字及其编号、标称主频
stepping : 3 #CPU属于制作更新版本
microcode : 0x1 #微代码
cpu MHz : 2394.378 #CPU的实际使用主频
cache size : 28160 KB #CPU二级缓存的大小
physical id : 0 #单个CPU的标号
siblings : 1 #单个CPU逻辑物理核数
core id : 0 #当前物理核在其所处CPU中的编号,这个编号不一定连续
cpu cores : 1 # 该逻辑核所处CPU的物理核数
apicid : 0 #用来区分不同逻辑核的编号,系统中每个逻辑核的此编号必然不同,此编号不一定连续
initial apicid : 0 #原始编号
fpu : yes # 是否具有浮点运算单元(Floating Point Unit)
fpu_exception : yes # 是否支持浮点计算异常
cpuid level : 13 # 执行cpuid指令前,eax寄存器中的值,根据不同的值cpuid指令会返回不同的内容
wp : yes #表明当前CPU是否在内核态支持对用户控件的写保护(Write Protection)
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss syscall nx pdpe1gb rdtscp lm constant_tsc rep_good nopl eagerfpu pni pclmulqdq ssse3 fma cx16 pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dnowprefetch fsgsbase bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx avx512f avx512dq rdseed adx smap avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 arat #当前CPU支持的功能
bogomips : 4788.75 #在系统内核启动时粗略测算的CPU速度(Million Instructions Per Second)
clflush size : 64 #每次刷新
cache_alignment : 64 #缓存地址对齐单位
address sizes : 46 bits physical, 48 bits virtual #可访问地址空间位数
power management: #对能源管理的支持

power management :对能源管理的支持,有以下几个可选支持功能:
  ts:  temperature sensor
  fid:  frequency id control
  vid:  voltage id control
  ttp:  thermal trip
  tm:
  stc:
  100mhzsteps:
  hwpstate:

CPU信息中flags各项含义:
fpu: Onboard (x87) Floating Point Unit
vme: Virtual Mode Extension
de: Debugging Extensions
pse: Page Size Extensions
tsc: Time Stamp Counter: support for RDTSC and WRTSC instructions
msr: Model-Specific Registers
pae: Physical Address Extensions: ability to access 64GB of memory; only 4GB can be accessed at a time though
mce: Machine Check Architecture
cx8: CMPXCHG8 instruction
apic: Onboard Advanced Programmable Interrupt Controller
sep: Sysenter/Sysexit Instructions; SYSENTER is used for jumps to kernel memory during system calls, and SYSEXIT is used for jumps: back to the user code
mtrr: Memory Type Range Registers
pge: Page Global Enable
mca: Machine Check Architecture
cmov: CMOV instruction
pat: Page Attribute Table
pse36: 36-bit Page Size Extensions: allows to map 4 MB pages into the first 64GB RAM, used with PSE.
pn: Processor Serial-Number; only available on Pentium 3
clflush: CLFLUSH instruction
dtes: Debug Trace Store
acpi: ACPI via MSR
mmx: MultiMedia Extension
fxsr: FXSAVE and FXSTOR instructions
sse: Streaming SIMD Extensions. Single instruction multiple data. Lets you do a bunch of the same operation on different pieces of input: in a single clock tick.
sse2: Streaming SIMD Extensions-2. More of the same.
selfsnoop: CPU self snoop
acc: Automatic Clock Control
IA64: IA-64 processor Itanium.
ht: HyperThreading. Introduces an imaginary second processor that doesn’t do much but lets you run threads in the same process a bit quicker.
nx: No Execute bit. Prevents arbitrary code running via buffer overflows.
pni: Prescott New Instructions aka. SSE3
vmx: Intel Vanderpool hardware virtualization technology
svm: AMD “Pacifica” hardware virtualization technology
lm: “Long Mode,” which means the chip supports the AMD64 instruction set
tm: “Thermal Monitor” Thermal throttling with IDLE instructions. Usually hardware controlled in response to CPU temperature.
tm2: “Thermal Monitor 2″ Decrease speed by reducing multipler and vcore.
est: “Enhanced SpeedStep”

相关计算

总核数 = 物理CPU个数 X 每颗物理CPU的核数

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

查看物理CPU个数 cat /proc/cpuinfo| grep “physical id”| sort| uniq| wc -l

查看每个物理CPU中core的个数(即核数) cat /proc/cpuinfo| grep “cpu cores”| uniq

查看逻辑CPU的个数 cat /proc/cpuinfo| grep “processor”| wc -l

查询系统CPU是否启用超线程:cat /proc/cpuinfo | grep -e “cpu cores” -e “siblings” | sort | uniq
输出结果
cpu cores : 1
siblings : 1
如果cpu cores数量和siblings数量一致,则没有启用超线程,否则超线程被启用。