系统中有很多命令可以查看cpu的个数,但是哪个命令输出的是逻辑cpu个数,哪个又是物理cpu个数呢?
从AIX5.3起,系统引入了SMT(Simultaneous multi-threading:同步多线程)的功能,其允许两个处理线程在同一颗处理器上运行,对操作系统而言,一颗物理处理器逻辑上会成为两个处理单元(逻辑处理器)。也就是说,在SMT功能启用的情况下,逻辑cpu个数是物理cpu个数的两倍,而在SMT功能禁用的情况下,逻辑cpu个数与物理cpu个数相等。
下面我们介绍如何通过各种命令检查系统中的物理cpu和逻辑cpu的个数。
1. smtctl
# smtctl
可以看到,该系统具有SMT能力且当前SMT功能已启用。16个物理cpu对应着64个逻辑cpu。
2. bindprocessor
# bindprocessor -q
可以看到可用逻辑cpu个数是64个(0-63)。
3. prtconf
# prtconf
System Model: IBM,8205-E6C
Machine Serial Number: ******
Processor Type: PowerPC_POWER7
Processor Implementation Mode: POWER 7
Processor Version: PV_7_Compat
Number Of Processors: 16 ——16个物理cpu
Processor Clock Speed: 3550 MHz
CPU Type: 64-bit
Kernel Type: 64-bit
LPAR Info: 1 02-8EE62
Memory Size: 31488 MB
Good Memory Size: 31488 MB
Platform Firmware level: AL740_126
Firmware Version: IBM,AL740_126
Console Login: enable
Auto Restart: true
Full Core: false
NX Crypto Acceleration: Not Capable
Network Information
Host Name: autochinaebs
IP Address: 192.168.1.123
Sub Netmask: 255.255.255.0
Gateway: 192.168.1.1
Name Server: 192.168.1.221
Domain Name: hand-china.com
Paging Space Information
Total Paging Space: 32768MB
Percent Used: 1%
Volume Groups Information
==============================================================================
Active VGs
appvg:
PV_NAME PV STATE TOTAL PPs FREE PPs FREE DISTRIBUTION
hdisk2 active 1999 38 00..00..00..00..38
rootvg:
hdisk0 active 558 412 111..41..37..111..112
hdisk1 active 558 418 111..47..37..111..112
INSTALLED RESOURCE LIST
The following resources are installed on the machine.
+/- = Added or deleted from Resource List.
* = Diagnostic support not available.
Model Architecture: chrp
Model Implementation: Multiple Processor, PCI bus
+ sys0 System Object
+ sysplanar0 System Planar
* vio0 Virtual I/O Bus
* vsa0 U8205.E6C.028EE62-V1-C0 LPAR Virtual Serial Adapter
* vty0 U8205.E6C.028EE62-V1-C0-L0 Asynchronous Terminal
* pci8 U78AA.001.WZSKF78-P1 PCI Express Bus
+ fcs2 U78AA.001.WZSKF78-P1-C6-T1 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet2 U78AA.001.WZSKF78-P1-C6-T1 Fibre Channel Network Protocol Device
+ fscsi2 U78AA.001.WZSKF78-P1-C6-T1 FC SCSI I/O Controller Protocol Device
* sfwcomm2 U78AA.001.WZSKF78-P1-C6-T1-W0-L0 Fibre Channel Storage Framework Comm
+ fcs3 U78AA.001.WZSKF78-P1-C6-T2 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet3 U78AA.001.WZSKF78-P1-C6-T2 Fibre Channel Network Protocol Device
+ fscsi3 U78AA.001.WZSKF78-P1-C6-T2 FC SCSI I/O Controller Protocol Device
* sfwcomm3 U78AA.001.WZSKF78-P1-C6-T2-W0-L0 Fibre Channel Storage Framework Comm
* pci7 U78AA.001.WZSKF78-P1 PCI Express Bus
* pci6 U78AA.001.WZSKF78-P1 PCI Express Bus
+ fcs0 U78AA.001.WZSKF78-P1-C4-T1 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet0 U78AA.001.WZSKF78-P1-C4-T1 Fibre Channel Network Protocol Device
+ fscsi0 U78AA.001.WZSKF78-P1-C4-T1 FC SCSI I/O Controller Protocol Device
* hdisk2 U78AA.001.WZSKF78-P1-C4-T1-W50050768030474FC-L0 MPIO IBM 2076 FC Disk
* sfwcomm0 U78AA.001.WZSKF78-P1-C4-T1-W0-L0 Fibre Channel Storage Framework Comm
+ fcs1 U78AA.001.WZSKF78-P1-C4-T2 8Gb PCI Express Dual Port FC Adapter (df1000f114108a03)
* fcnet1 U78AA.001.WZSKF78-P1-C4-T2 Fibre Channel Network Protocol Device
+ fscsi1 U78AA.001.WZSKF78-P1-C4-T2 FC SCSI I/O Controller Protocol Device
* sfwcomm1 U78AA.001.WZSKF78-P1-C4-T2-W0-L0 Fibre Channel Storage Framework Comm
* pci5 U78AA.001.WZSKF78-P1 PCI Express Bus
* pci4 U78AA.001.WZSKF78-P1 PCI Express Bus
+ ent0 U78AA.001.WZSKF78-P1-C2-T1 4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent1 U78AA.001.WZSKF78-P1-C2-T2 4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent2 U78AA.001.WZSKF78-P1-C2-T3 4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
+ ent3 U78AA.001.WZSKF78-P1-C2-T4 4-Port Gigabit Ethernet PCI-Express Adapter (e414571614102004)
* pci3 U78AA.001.WZSKF78-P1 PCI Express Bus
* pci2 U78AA.001.WZSKF78-P1 PCI Express Bus
* pci1 U78AA.001.WZSKF78-P1 PCI Express Bus
* pci9 U78AA.001.WZSKF78-P1 PCI Bus
+ usbhc0 U78AA.001.WZSKF78-P1 USB Host Controller (33103500)
+ usbhc1 U78AA.001.WZSKF78-P1 USB Host Controller (33103500)
+ usbhc2 U78AA.001.WZSKF78-P1 USB Enhanced Host Controller (3310e000)
* pci0 U78AA.001.WZSKF78-P1 PCI Express Bus
+ sissas0 U78AA.001.WZSKF78-P1-T9 PCIe x4 Planar 3Gb SAS Adapter
* sas0 U78AA.001.WZSKF78-P1-T9 Controller SAS Protocol
* sfwcomm4 SAS Storage Framework Comm
+ hdisk0 U78AA.001.WZSKF78-P2-D1 SAS Disk Drive (300000 MB)
+ hdisk1 U78AA.001.WZSKF78-P2-D2 SAS Disk Drive (300000 MB)
+ ses0 U78AA.001.WZSKF78-P2-Y1 SAS Enclosure Services Device
+ ses1 U78AA.001.WZSKF78-P2-Y1 SAS Enclosure Services Device
* sata0 U78AA.001.WZSKF78-P1-T9 Controller SATA Protocol
* cd0 U78AA.001.WZSKF78-P2-D9 SATA Optical Drive
+ L2cache0 L2 Cache
+ mem0 Memory
+ proc0 Processor
+ proc4 Processor
+ proc8 Processor
+ proc12 Processor
+ proc16 Processor
+ proc20 Processor
+ proc24 Processor
+ proc28 Processor
+ proc32 Processor
+ proc36 Processor
+ proc40 Processor
+ proc44 Processor
+ proc48 Processor
+ proc52 Processor
+ proc56 Processor
+ proc60 Processor
可以看到系统中有8个逻辑cpu。
查看cpu是几个核心的:
A:物理逻辑个数 A=pmcycles -m
B:CPU物理个数 B=prtconf|grep Processors
C:核数 C=A/B