1. 程式人生 > >關於在centos6 + grub的舊版本中,如何關閉CPU throttling

關於在centos6 + grub的舊版本中,如何關閉CPU throttling

ng- sta cat 1.2 name 很快 _cmd sca inf

由於個人需求,要編譯安裝ATLAS庫,其中就有關閉CPU throttling的步驟,

最常規簡單的方法是修改grub

  /etc/default/grub/

之後再接一些簡單的步驟 + 重啟就完成了。

剛開始看到的時候,我自覺輕松,很快就能完成了,但很快就懵逼了。

由於系統上的grub不是2,根本沒有/etc/default/grub/這玩意,什麽update-grub之類自不必說了。

我研究了很久之後,嘗試修改/boot/grub/menu.lst,然後當然依然是無果,那是相當的絕望。。。

所幸,最終重新嘗試利用軟件cpufrequtils,得到想要的效果,特此總結一下。


一. 查看途徑
1. cat /proc/cpuinfo
(BTW, cat /proc/cpuinfo | grep "cpu MHz",光只是查看cpu頻率)
model name : Intel(R) Xeon(R) CPU E5-1620 v2 @ 3.70GHz
stepping : 4
microcode : 1064
cpu MHz : 3701.000
上面是3.7GHz, 下面顯示的cpu MHz也是3700Hz, 表明已經關閉CPU throttling;


2. cat /proc/acpi/processor/CPU0/info
processor id: 0
acpi id: 0
bus mastering control: yes
power management: no
throttling control: yes
limit interface: yes
利用cpufreq-selector修改之後, 這裏的throttling control仍然是yes, 但是ATLAS可以成功安裝。
我覺得或許還是需要改變grub啟動配置。
但是系統和grub都為舊版本, 找不到合適的關閉方法, 只能先追求完成目標。


3. cpufreq-info
我的環境並cpufreq的查看並不是這個指令, 具體暫不詳。


--參考鏈接:https://www.thegeekdiary.com/how-to-check-if-cpu-throttling-is-enabled-on-centos-rhel-6/
https://blog.csdn.net/lostman80/article/details/10454447

二. 關閉途徑
1. 修改開機啟動項(不知道何種問題,並不行)
1.1 對於舊版的grub
sudo vim /boot/grub/menu.lst
//在其中加上intel_pstate=disable
sudo reboot

1.2 對於新版的grub2
Edit /etc/default/grub
Find line with: GRUB_CMDLINE_LINUX_DEFAULT
Append the following to args: intel_pstate=disable
Update grub: update-grub (在centos中並不是如此,很容易百度)
Reboot
這種方法,失敗了。


2. 安裝cpufrequtils, 使用此軟件幫助修改
可能是cpufreq-selector, 也有可能是cpufreq-set,
我的環境是cpufreq-selector;

/usr/bin/cpufreq-selector -g performance -c 0
/usr/bin/cpufreq-selector -g performance -c 1
......
/usr/bin/cpufreq-selector -g performance -c n

另外的方法:

運行/usr/bin/cpufreq-selector -g performance -c 0

cp /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
......
cp /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor /sys/devices/system/cpu/cpuN/cpufreq/scaling_governor
(這種嘗試過, 但是失敗)

如無相應軟件, 可用apt-get或者yum(OS而定)進行安裝, 例:
sudo apt-get install cpufrequtils

3. 修改BIOS
並未作嘗試, 這個不太熟悉, 感覺比較危險;

4. 一些查到的, 未知具體含義的指令
sudo service cpuspeed stop
pupower frequency-set -g
performance, sudo cpupower frequency-set -d 2000000

這些都沒能解決當前環境的問題, 並且完全不明白, 也是個例。
但記錄下來, 可能在別的環境下需要用到。

4的來源鏈接:https://unix.stackexchange.com/questions/324710/how-to-disable-cpu-frequency-scaling-in-centos-6

關於在centos6 + grub的舊版本中,如何關閉CPU throttling