[转帖]Linux禁用CPU省电状态/Linux系统性能调优
https://www.jianshu.com/p/945168b47487
How to Disable CPU Power Saving States on a Redhat or Suse Linux System
For RedHat Linux (release 7 and later)
- Open the /etc/default/grub configuration file as root using a plain text editor such as vim or Gedit.
- In this file, locate the line beginning with GRUB_CMDLINE_LINUX similar to the following:
GRUB_CMDLINE_LINUX="rd.lvm.lv=rhel/swap crashkernel=auto rd.lvm.lv=rhel/root rhgb quiet"
- Change the value of the required kernel command-line parameter. Then, save the file and exit the editor.
intel_idle.max_cstate=0
processor.max_cstate=1 - Regenerate the GRUB2 configuration using the edited default file. If your system uses BIOS firmware, execute the following command:
# grub2-mkconfig -o /boot/grub2/grub.cfg
On a system with UEFI firmware, execute the following instead:
# grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
After finishing the procedure above, the boot loader is reconfigured, and the kernel command-line parameter that you have specified in its configuration file is applied after the next reboot.
For RedHat Linux (releases prior to 7) or SuSE Linux
- Add the following text to the kernel line in /boot/grub/menu.lst:
intel_idle.max_cstate=0
processor.max_cstate=1 - Reboot the system for the change to take effect.
How to Disable CPU Power Saving States on a Debian Linux System
To disable CPU power saving states on a Debian Linux system, perform the following procedure:
- Modify the GRUB_CMDLINE_LINUX string in /etc/default/grub so that it contains:
intel_idle.max_cstate=0
processor.max_cstate=1 - Run "update-grub".
- Reboot the system for the change to take effect.
Note: Disabling CPU power saving states in the system BIOS has no effect on Linux.
In some cases, performance can also be improved by adjusting the idle kernel parameter. However, care should be taken when using certain values. For example, idle=poll maximizes performance but is incompatible with hyperthreading (HT) and will lead to very high power consumption. For additional information, refer to the documentation for your version of Linux.
On Windows, disable CPU power saving states by adjusting BIOS settings. Refer to system vendor documentation for additional information.