Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Open Source Software and Platforms
Open Source Software and Platforms
Wiki cpuidle (hotplug)
  • Help
  • Jump...
  • Cancel
  • About this wiki
  • Supported platforms
  • Obtaining support
  • +Arm Reference Platforms deliverables
  • +A-class platforms
  • +M-class platforms
  • +R-class platforms
  • +FPGA prototyping boards
  • -Open source software
    • -Linux/Android
      • ------- Power management -------
      • cpufreq (DVFS)
      • cpuidle (hotplug)
      • +Energy Aware Scheduling (EAS)
      • System Suspend to RAM
      • ------- Configuration -------
      • +Device Tree
      • Modify Linux kernel config flags in the Arm Platforms deliverables
      • ----- Virtualization -----
      • Spawn a Linux virtual machine on Arm using QEMU (KVM)
      • ------- User-space -------
      • Android
      • Debian
      • Fedora Server
      • OpenEmbedded
      • Build a Buildroot user-space
      • Build an ILP32 user-space
      • BusyBox
    • +Trusted Firmware-A
    • Trusted Firmware-M
    • +EDK II UEFI
    • OP-TEE
    • +U-Boot
    • Robotics
    • Mbed OS
    • +SCP

You are currently reviewing an older revision of this page.

  • History View current version

cpuidle (hotplug)

CPU hotplug

The Linux kernels included in the Linaro software deliverables are able to dynamically enable and disable CPUs at runtime without having to reboot the system; this is known as CPU "hotplugging".

To list all available CPUs:

# ls /sys/devices/system/cpu
cpu0
cpu1
cpu2
cpu3
cpu4
cpu5

To hotplug CPU 3 out of the system:

# echo 0 > /sys/devices/system/cpu/cpu3/online
[ 765.452857] CPU1: shutdown
[ 765.458335] psci: CPU3 killed.

And to hotplug that CPU back in to the system:

# echo 1 > /sys/devices/system/cpu/cpu3/online

We can verify whether the CPU is disabled by reading `/proc/cpuinfo':

# grep processor /proc/cpuinfo
processor : 0
processor : 1
processor : 2
processor : 4
processor : 5

The actual effect of hotplugging a CPU out of the system will depend on your particular hardware and drivers; some systems may simply place the offlined CPUs into a busy idle loop whereas other systems such as the Juno will physically remove power from the specified core.

For more information see the PSCI specification.

Device Tree

The Device Tree passed to the Linux kernel defines which CPUs are available within the system, so it's also possible to control the number of running CPUs by removing the corresponding nodes from the Device Tree (see here), though this cannot be modified at runtime.

cpuidle

The cpuidle subsystem allows the kernel to dynamically hotplug CPUs in and out of the system based on the current workload.

Instructions for disabling cpuidle can be found in this troubleshooting document.