-
Notifications
You must be signed in to change notification settings - Fork 0
/
power-management.txt
108 lines (72 loc) · 5.55 KB
/
power-management.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# A collection of notes for power management on Linux
The most common tools
- [Powertop](https://wiki.archlinux.org/title/powertop) - Tool to identify ways to optimize power consumption. Does not have a daemon or anything like it.
The best setup seems to be auto-cpufreq + thermald. PowerTop can be used to troubleshoot and finetune settings but don't think it is necessary. Many tools interfere with each other so it is in my experience best to keep it simple.
- [Powertop](https://wiki.archlinux.org/title/powertop)
- tlp
- Laptop Mode Tools
- [auto-cpufreq](https://github.com/AdnanHodzic/auto-cpufreq) - Tries to let the kernel do the heavy lifting. This is my goto choice, but it falls short in certain areas such as ALPM. Recommends to run thermald alongside.
- thermald - TODO.
- [pm-utils](https://cgit.freedesktop.org/pm-utils/tree/README) - Don't know how this compares to the others. I think TLP depend on pm-utils.
- GNOME Power Profiles - This is appearently crap...
- UPower
(Does not include power management features that seem irrelevant for my laptop, like harddrive stuff, XFS etc.)
| Tool | laptop_mode | Disable WOL | Disable HAL polling | Intel Audio power save | PCIE ASPM
| pm-utils | | * | * | * | *
| TLP | | * | * | * | *
| Laptop Mode Tools | | * | * | * | *
| auto-cpufreq | | * | * | * | *
| thermald | | * | * | * | *
| pm-utils | yes | yes | yes | yes | yes
- Intel Audio power save - Seems to be enabled by default
- ASPM seems to have good settings by defaul. One liner to check status: `sudo lspci -vvv | grep LnkCtl`
## Storage
According to [ArchWiki](https://wiki.archlinux.org/title/Solid_state_drive) ALPM is usually disabled by default which can consume a lot of power.
## Sleep, hibernate and other scary stuff
- auto-cpufreq
- thermald
- [cpufreq](https://github.com/konkor/cpufreq) (it is actually used by auto-cpufreq)
A good wiki of tools can be found here: https://wiki.archlinux.org/title/CPU_frequency_scaling
`cat /sys/power/mem_sleep`
# Resources
- [Good resource for ALPM](https://wireless.wiki.kernel.org/en/users/documentation/aspm)
## Power management in Linux distros
- [Open SUSE](https://documentation.suse.com/sles/15-SP3/html/SLES-all/cha-tuning-power.html)
- [Ubuntu](https://wiki.ubuntu.com/Kernel/PowerManagement/PowerSavingTweaks)
# CPU frequency scaling
https://wiki.archlinux.org/title/CPU_frequency_scaling
`schedutil` was used on my UX303. This is because of the cpu scaling driver being set to `intel_cpufreq`.
```cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_driver```
It seems reasonable to asume that the hardware backed intel pstate scaling would do a better job.
How to change it to pstate: https://askubuntu.com/a/1184512
Benchmarks: https://www.phoronix.com/review/linux50-pstate-cpufreq/6
Some people seem to really dislike [shedutil](https://www.phoronix.com/forums/forum/software/general-linux-open-source/1486834-experimental-schedutil-patches-yield-30-boost-to-web-browser-benchmark-on-linux?p=1486848#post1486848).
Some people seem to reallt dislike [intel pstate](https://www.phoronix.com/forums/forum/hardware/processors-memory/1173150-initial-benchmarks-of-schedutil-performance-on-linux-5-7-show-room-still-for-improvement?p=1214010#post1214010).
https://www.phoronix.com/review/xeon-linux57-schedutil/7
https://www.phoronix.com/review/amd-linux511-perfgov/2
I think I found [the reason](https://www.reddit.com/r/linux/comments/ihdozd/linux_kernel_58_defaults_to_passive_mode_for/) but I am not sure if it is valid:
https://www.phoronix.com/news/P-State-Passive-Def-For-No-HWP
# PowerTop vs. TLP
https://linrunner.de/tlp/faq/powertop.html
[Regarding VM writeback](https://askubuntu.com/a/1228723), PowerTop takes a more naive approach that works well for laptops - my case.
# TODO
- [Investigate hiberation](https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate)
- Investigate Intel Rapid Start Technology
- Investigate possibility to use suspend-then-hibernate
# XPS 9320
- https://wiki.archlinux.org/title/Dell_XPS_13_Plus_(9320)
- This bug is preventing sleep? https://bugzilla.kernel.org/show_bug.cgi?id=213047
- https://github.com/intel/S0ixSelftestTool
- Using `./s0ix-self-test.sh -s` confirms the processor is able to achieve s0ix.
- Interesting thread: https://www.dell.com/community/en/conversations/xps/xps-13-plus-ubuntu-2204-does-not-support-deep-sleep/647f9fa5f4ccf8a8de483a80
- According to [this thread](https://www.dell.com/community/en/conversations/xps/proscons-ahci-vs-raid-on-xps13-9300-nvme/647f89cef4ccf8a8de97b145) I should use AHCI instead of VMD/Raid (related to [this bug report](https://bugzilla.kernel.org/show_bug.cgi?id=211879)).
# Intel p_state driver vs. acpi
Kernel Documentation:
https://www.kernel.org/doc/Documentation/cpu-freq/intel-pstate.txt
https://www.kernel.org/doc/Documentation/cpu-freq/user-guide.txt
https://www.kernel.org/doc/Documentation/cpu-freq/governors.txt
https://www.kernel.org/doc/html/v6.2/admin-guide/pm/intel_pstate.html
https://www.kernel.org/doc/html/v6.2/admin-guide/pm/intel_pstate.html#intel-pstate-vs-acpi-cpufreq
Performance tests:
https://www.phoronix.com/review/intel_pstate_linux315/3
https://www.phoronix.com/review/linux50-pstate-cpufreq