新聞中心
CPU頻率,即CPU的時鐘頻率(也叫主頻),是指CPU運算時的工作的頻率。CPU頻率決定了計算機的運行速度,同級別的產(chǎn)品主頻越高越強,一款CPU主頻越高,說明單核性能就強。

Gnome下查看
\1) 在Gnome菜單欄的底部面板上點右鍵 —> 添加到面板 –> CPU頻率范圍監(jiān)視器 , 然后gnome面板上就會出現(xiàn)此小工具,并顯示當(dāng)前的頻率, 點左鍵可出現(xiàn)可調(diào)節(jié)的頻率
命令行下查看
\1) 安裝cpufrequtils 此軟件是查看cpu當(dāng)前頻率以及修改頻率、選擇cpu、選擇cpu運行方式的。注意,只支持某些可調(diào)節(jié)頻率的cpu,如intel的筆記本cpu
sudo apt-get install cpufrequtils 或 yum install cpufrequtils
2)使用方法 cpufreq-info, cpufreq-selector, cpufreq-set。
a) 查看cpu類型、當(dāng)前頻率、支持頻率、運行模式等
[root@codeLife codeLife]# cpufreq-info -m
cpufrequtils 007: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: powernow-k8
CPUs which run at the same hardware frequency: 0
CPUs which need to have their frequency coordinated by software: 0
maximum transition latency: 8.0 us.
hardware limits: 800 MHz – 2.90 GHz
available frequency steps: 2.90 GHz, 2.20 GHz, 1.70 GHz, 800 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 800 MHz and 2.90 GHz.
The governor “userspace” may decide which speed to use
within this range.
current CPU frequency is 800 MHz (asserted by call to hardware).
analyzing CPU 1:
driver: powernow-k8
CPUs which run at the same hardware frequency: 1
CPUs which need to have their frequency coordinated by software: 1
maximum transition latency: 8.0 us.
hardware limits: 800 MHz – 2.90 GHz
available frequency steps: 2.90 GHz, 2.20 GHz, 1.70 GHz, 800 MHz
available cpufreq governors: ondemand, userspace, performance
current policy: frequency should be within 800 MHz and 2.90 GHz.
The governor “userspace” may decide which speed to use
within this range.
current CPU frequency is 800 MHz (asserted by call to hardware).
b)選擇需要調(diào)整的cpu
sudo cpufreq-selector -c cpu號 或者 sudo cpufreq-set -c cpu號
可能對雙核或多核cpu進行選擇。我的不是雙核,沒法實驗,還請有duo core的朋友實驗一下并跟帖匯報情況。
c)調(diào)整cpu頻率
sudo cpufreq-selector -f 你所需要的頻率 或者 sudo cpufreq-set -f 你所需要的頻率
注意,此處的頻率必須是以KHz為單位,并且是可以達到的頻率(也就是用cpufreq-info查看到的各個頻率),cpu頻率=倍頻x外頻。以下凡是涉及頻率的一律如此。
d)調(diào)整cpu頻率上下限
sudo cpufreq-set -d 頻率下限 sudo cpufreq-set -u 頻率上限
因此,可能可以對cpu進行降頻或者超頻。有些人肯定會躍躍欲試的,嘿嘿。
e)調(diào)整cpu運行模式
sudo cpufreq-selecotr -g 模式 或者 suod cpufreq-set -g 模式 這里,模式就是執(zhí)行cpufreq-info后看到的所支持的模式。比如我的支持以下幾種:powersave, userspace, ondemand, conservative, performance。
powersave, 是無論如何都只會保持最低頻率的所謂“省電”模式;
userspace, 是自定義頻率時的模式,這個是當(dāng)你設(shè)定特定頻率時自動轉(zhuǎn)變的;
ondemand, 默認模式。一有cpu計算量的任務(wù),就會立即達到最大頻率運行,等執(zhí)行完畢就立即回到最低頻率;
conservative,翻譯成保守(中庸)模式,會自動在頻率上下限調(diào)整,和ondemand的區(qū)別在于它會按需分配頻率,而不是一味追求最高頻率;
performance,顧名思義只注重效率,無論如何一直保持以最大頻率運行。
12345
f)添加cpu監(jiān)視器
監(jiān)視cpu頻率的系統(tǒng)就有,右鍵單擊面板,選擇“添加到面板”,里面找到“cpu頻率范圍監(jiān)視器”。 另外,如果嫌命令行麻煩,可以這么做
sudo chmod +s /usr/bin/cpufreq-selector 然后,cpu頻率范圍監(jiān)視器的首選項里就會多出一個“頻率選擇器”,顯示菜單選擇“頻率和調(diào)速器”。鼠標左鍵單擊cpu頻率范圍監(jiān)視器,會發(fā)現(xiàn)“頻率”和“調(diào)速器”兩個菜單,就可以隨便調(diào)了。在這里特別感謝Vstar。
監(jiān)視溫度的需要自己安裝,
sudo apt-get install sensors-applet 然后也是這樣添加到面板,名字叫“Hardware sensors monitor”。
網(wǎng)頁題目:Linux中查看并設(shè)置CPU頻率
URL鏈接:http://www.dlmjj.cn/article/djeddsj.html


咨詢
建站咨詢
