首页 > 其他 > 详细

关于在centos6 + grub的旧版本中,如何关闭CPU throttling

时间:2019-02-19 20:15:40      阅读:488      评论:0      收藏:0      [点我收藏+]

由于个人需求,要编译安装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

原文:https://www.cnblogs.com/INT18/p/10403052.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!