- 论坛徽章:
- 0
|
如果是在启动的时候可以在grub里边kernel的那一行添加参数 maxcpus=1 将传递cpu一个内核给操作系统
建议有问题先去各厂商的官方网站去搜索
http://kbase.redhat.com/faq/docs/DOC-15523
Release Found: Red Hat Enterprise Linux 5 and later
Problem
You want to dynamically enable or disable a CPU on a running system.
Solution
Red Hat Enterprise Linux 5 supports the cpu-hotplug mechanism, which allows for CPUs to be dynamically disabled and re-enabled on a system without requiring a system reboot. Note: CPU hot-plugging will only work if physical hotplug is supported by the hardware.
In order to disable a CPU core in a running machine, use the file /sys/devices/system/cpu/cpuX/online.
The following command will disable a CPU:
# echo 0 > /sys/devices/system/cpu/cpuX/online
Where X is the ID of the CPU as determined from /proc/cpuinfo.
To re-enable the CPU, run:
# echo 1 > /sys/devices/system/cpu/cpuX/online
Example:
The following output from /proc/cpuinfo shows two processors on a system:
root@xen # grep "processor" /proc/cpuinfo
processor : 0
processor : 1
In order to disable CPU 1, echo "0" to /sys/devices/system/cpu/cpu1/online:
root@xen# echo 0 > /sys/devices/system/cpu/cpu1/online
cpu0/ cpu1/
Check /proc/cpuinfo to see if the cpu is disabled .
root@xen # grep "processor" /proc/cpuinfo
processor : 0
Notice that there is now only one processor shown (CPU 0) instead of two. |
评分
-
查看全部评分
|