如何查看CPU核心

root@pangu:~# cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 48.00
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

processor	: 1
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 48.00
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: STM32 (Device Tree Support)
Revision	: 0000
Serial		: 003D00413239510A33363835

禁用一个CPU核心

root@pangu:~# echo 0 > /sys/devices/system/cpu/cpu1/online
CPU1: shutdown
root@pangu:~# cat /proc/cpuinfo
processor	: 0
model name	: ARMv7 Processor rev 5 (v7l)
BogoMIPS	: 48.00
Features	: half thumb fastmult vfp edsp thumbee neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm
CPU implementer	: 0x41
CPU architecture: 7
CPU variant	: 0x0
CPU part	: 0xc07
CPU revision	: 5

Hardware	: STM32 (Device Tree Support)
Revision	: 0000
Serial		: 003D00413239510A33363835

启用已经被禁用的CPU核心

root@st:~# echo 1 > /sys/devices/system/cpu/cpu1/online
CPU1: shutdown
作者:SteveChen  创建时间:2024-09-18 11:57
最后编辑:SteveChen  更新时间:2024-10-18 15:16