Skip to content

Commit 4b24475

Browse files
committed
Update: Linux
1 parent f58baad commit 4b24475

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
========================================
2+
CPU Frequency
3+
========================================
4+
5+
6+
.. contents:: 目錄
7+
8+
9+
CPU frequency driver
10+
========================================
11+
12+
.. code-block:: sh
13+
14+
ls /usr/lib/modules/$(uname -r)/kernel/drivers/cpufreq/
15+
16+
17+
Intel CPU 可能會使用 P-state driver,
18+
但是可以透過以下更動來關閉,
19+
藉此切換到 acpi-cpufreq driver:
20+
21+
``/etc/default/grub``:
22+
23+
.. code-block:: conf
24+
25+
GRUB_CMDLINE_LINUX_DEFAULT="... intel_pstate=disable"
26+
27+
28+
使用 acpi-cpufreq driver 後,
29+
Linux 5.10 以上會讓 schedutil 來控制速度。
30+
31+
32+
看現在的機制:
33+
34+
.. code-block:: sh
35+
36+
cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
37+
38+
39+
40+
工具 - cpupower
41+
========================================
42+
43+
.. code-block:: sh
44+
45+
sudo pacman -S cpupower
46+
47+
# 看現在狀態
48+
cpupower frequency-info
49+
# 設定上限
50+
sudo cpupower frequency-set -u 3900000
51+
# 設定下限
52+
sudo cpupower frequency-set -d 3900000
53+
# 設定速度
54+
sudo cpupower frequency-set -f 3900000
55+
56+
57+
58+
參考
59+
========================================
60+
61+
* `Arch Wiki - CPU frequency scaling <https://wiki.archlinux.org/index.php/CPU_frequency_scaling>`_

0 commit comments

Comments
 (0)