Before you begin
Daemon processes like cpuplugd can change the state of any CPU at any
time. Such changes can interfere with manual changes.
Procedure
- Optional:
Rescan the CPUs to ensure that Linux® has a
current list of configured CPUs.
To initiate a rescan, issue the
chcpu command with the
-r
option.
# chcpu -r
Alternatively, you can write
1
to
/sys/devices/system/cpu/rescan.
You might need a rescan for Linux on z/VM® after one or more CPUs have been added to the z/VM guest virtual machine by the z/VM hypervisor.
Linux on KVM and Linux in LPAR mode automatically detect newly available
CPUs.
-
Change the online state of a CPU by issuing a command of this form:
# chcpu -e|-d <N>
where
- <N>
- is the number of the logical CPU.
- -e
- sets an offline CPU online. Only CPUs that are in the configuration state
configured
can be set online. For Linux on
z/VM, all CPUs are in the configured
state.
- -d
- sets an online CPU offline.
Alternatively, you can write 1
to the online sysfs
attribute of a CPU to set it online, or 0
to set it offline.