0%

CPU hotplug in the Kernel

Linux 支持多核 CPU 热插拔

CPU 架构

  • SMP(Symmetric Multiprocessing) 对称多处理器
  • NUMA(Non-Uniform Memory Access) 非均匀访问存储模型
  • MPP(Massive Parallel Processing)

使用的嵌入式内核为 SMP,在 SMP 中所有的处理器都是对等的,它们通过总线连接共享同一块物理内存,这也就导致了系统中所有资源 ( CPU内存I/O 等)都是共享的

cpu hotplug

内核配置

[*] Symmetric Multi-Processing
    [*]   Allow booting SMP kernel on uniprocessor systems
    [*]   Support cpu topology definition
    [ ]     Multi-core scheduler support
    [ ]     SMT scheduler support
    -*- Architected timer support
    [ ] Multi-Cluster Power Management
    [ ] big.LITTLE support (Experimental)
        Memory split (3G/1G user/kernel split)  --->
    (2) Maximum number of CPUs (2-32)
    -*- Support for hot-pluggable CPUs

使用命令 ls -l /sys/devices/system/cpu/ 查询多核状态
使用命令 echo 0 > /sys/devices/system/cpu/cpu1/online 关闭 cpu1