← 返回命令列表

Linux command

chcpu 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Disable

chcpu -d [1,3]

Enable

chcpu -e [1-3,5-7]

Configure

chcpu -c [0,1,2]

Deconfigure

chcpu -g [3,4]

Rescan

chcpu -r

Set CPU dispatching mode

chcpu -p [horizontal]

说明

chcpu can enable or disable CPUs, scan for new CPUs, change the CPU dispatching mode of the underlying hypervisor, and request CPUs from the hypervisor (configure) or return CPUs to the hypervisor (deconfigure). CPUs are specified by their logical IDs using a comma-separated cpu-list that can contain individual addresses or ranges (e.g., `0,5,7,9-11`).

参数

-c, --configure _cpu-list_
Configure the specified CPUs. The hypervisor takes a CPU from the CPU pool and assigns it to the virtual hardware on which your kernel runs.
-d, --disable _cpu-list_
Disable the specified CPUs. The kernel sets them offline.
-e, --enable _cpu-list_
Enable the specified CPUs. The kernel sets them online. A CPU must be configured before it can be enabled.
-g, --deconfigure _cpu-list_
Deconfigure the specified CPUs. The hypervisor removes the CPU from the virtual hardware and returns it to the CPU pool.
-p, --dispatch _mode_
Set the CPU dispatching mode (polarization). Supported modes are `horizontal` (workload spread across all CPUs) and `vertical` (workload concentrated on few CPUs). Only effective if the hardware architecture and hypervisor support CPU polarization.
-r, --rescan
Trigger a rescan of CPUs. After a rescan, the Linux kernel recognizes new CPUs.
-h, --help
Display help text and exit.
-V, --version
Print version information and exit.

FAQ

What is the chcpu command used for?

chcpu can enable or disable CPUs, scan for new CPUs, change the CPU dispatching mode of the underlying hypervisor, and request CPUs from the hypervisor (configure) or return CPUs to the hypervisor (deconfigure). CPUs are specified by their logical IDs using a comma-separated cpu-list that can contain individual addresses or ranges (e.g., `0,5,7,9-11`).

How do I run a basic chcpu example?

Run `chcpu -d [1,3]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -c, --configure _cpu-list_ do in chcpu?

Configure the specified CPUs. The hypervisor takes a CPU from the CPU pool and assigns it to the virtual hardware on which your kernel runs.