In the past few week I played a bit around with the Linux amd_pstate driver and scheduling in general on my Framework 13. I did some benchmarks to find out the optimal pstate and governor settings for different scenarios and now want to share my results with you.
Before you continue, if you have no idea what the hell the amd_pstate driver is read this great reddit post and this phoronix article first. Also have a look at the CPU frequency scaling entry on the Arch wiki and for in-depth information, consult the kernel doc.
First off, some details about my system:
- System: Framework Laptop 13 (AMD edition)
- CPU: AMD Ryzen 7 7840U
- Memory: 2x32GB DDR5-5600MT/s
- OS: Arch Linux
- Kernel: 6.7.5.arch1-1
- Power management: power-profiles-daemon
For benchmarking, I used the Phoronix Test Suite and ran a quite randomly assembled mix of multi and single core benchmark suites:
- Multi core:
- pts/openssl
- RSA4096
- SHA512
- AES-256-GCM
- ChaCha20-Poly1305
- pts/stockfish
- pts/m-queens
- pts/openssl
- Single core:
- pts/crafty
- pts/compress-gzip
- pts/encode-mp3
- pts/encode-flac
- pts/espeak
I ran the tests for every possible combination of pstate setting, CPU governor and ACPI platform profile (APP) setting and recorded the geometric mean of performance and power consumption for all tests. For the active mode, I also tested with every combination of energy profile preferences. Also, I run the test suites at night, so there should have been no relevant background noise.
The results were quite interesting. My main points of interest were performance, power consumption and performance per watt. For all those three points the results clearly shows that the most effective setting affecting those is the APP. The powersave
governor can also make a great difference however. Thus I partitioned the results according to this and came up with four scenarios:
- Performance: Best performance possible regardless of energy consumption/efficiency.
- Balanced: Good balance between performance and energy consumption while also maintaining a good energy efficiency.
- Powersave: Low energy consumption and maximum energy efficiency.
- Extreme powersave: Save as much power as possible regardless of performance or energy efficiency.
As expected, for maximum performance the performance
APP works best. Also guided
works better than passive
. A bit unexpected is that the schedutil
governor actually beats the performance
governor.
For the balanced scenario, also as expected the balanced
APP works best. As for the governor, schedutil
is a wise choice here since it offers the best results AND the lowest energy consumption. The pstate setting here does not make much of a difference but I’d vote for passive
here since it offers better performance and power consumption together with the schedutil
governor and the balanced
APP.
For powersave, the best energy efficiency is achieved with the low-power
APP in combination with the schedutil
governor, but the least power is drawn with the powersave
governor. However, the energy efficiency of the powersave
governor is unacceptably bad so it it not an option here. The pstate mode also does matter that much here, but guided
scores a bit better than passive
so let’s go with it.
As mentioned above, despite the horrible efficiency the least energy is drawn with the powersave
governor, which makes it a good candidate for extrem powersaving. Suprisingly, this works best combined with the performance
APP and the passive
governor.
If you want to have a look at the results for yourself you can find them in the attached analysis.ods file. Note that I had to change the extension to .stl
as otherwise I wouldn’t be able to upload it. To view it, just rename it to analysis.odt
.
That’s it. Thank you for reading. I hope my work was useful or at least interesting for you :).
EDIT: For those interested I thought I’d also share the raw results exported from Phoronix as HTML. Have a look at them here: raw_results_sanitized.min.html (again please remove the .stl
extension I only put there to avoid upload restrictions).