Lenovo ThinkPad T480 and Slackware - experiences and CPU frequency problem
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
thanks for this script - I just had to change the way the governor is switched:
Code:
#!/bin/sh
# Default value on battery [$1 = "true"]
SCALING_GOVERNOR_BAT="powersave"
# Default value on AC [$1 = "false"]
SCALING_GOVERNOR_AC="performance"
set_cpufreq() {
case $1 in
bat) SCALING_GOVERNOR=$SCALING_GOVERNOR_BAT;;
ac) SCALING_GOVERNOR=$SCALING_GOVERNOR_AC;;
esac
printf "Setting CPU frequency scaling governor to %s..." "$SCALING_GOVERNOR"
pstate-frequency -S -g $SCALING_GOVERNOR
[ "$?" -eq 0 ] && echo Done. || echo Failed.
}
case $1 in
true) set_cpufreq bat;;
false) set_cpufreq ac;;
*) exit $NA;;
esac
exit 0
and now the governor is automatically changed when the power is plugged in or out.
I did some testing - compiling latest kernel from kernel.org - and it takes 5min 14sec with the 'powersave' governor, and 3min 59sec with the 'performance' governor.
Update: added another NVMe drive to M.2 slot (WDC CL SN520 SDAPMUW-512G-1022, 2242). The drive temperature is 44 degrees Celsius (compared to ~35 degrees Celsius for built-in LITEON CA3-8D512 drive).
The speed is ~880MB/s:
Code:
bash-5.0# dd if=/dev/zero of=zero2 bs=1M count=1024 oflag=direct
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 1.22188 s, 879 MB/s
# Attempt to apply the CPU scaling governor setting. This may or may not
# actually override the default value depending on if the choice is supported
# by the architecture, processor, or underlying CPUFreq driver. For example,
# processors that use the Intel P-state driver will only be able to set
# performance or powersave here.
Nice explanation for people interested to better understand this topic. Have you, maybe, tried to compare/benchmark speed and power efficiency when intel_pstate is enabled/disabled?
Distribution: slackware x86_64 , arm , slackware , AlmaLinux
Posts: 83
Rep:
Hi - you
I have tested these things witch i have presented there with an "Energy-Meter" with an Accuracy of +/- 0.5%
and the idle difference of my Computers has been around 1% when using powersave from CPUfreq or from intel so this is less
interesting ... other data could bee found on Phoronix ...
but the most interesting for me is that the intel p-state driver is JUST a SWITCH between two options - the upper OR the lower frequency range
so one could NOT change these ranges without MANUAL changig them - that may be interesting if you have got a laptop and a tool which did this SWITCH
but if you have a desktop or server - this should be done automaticaly when needed - that had been done for years by CPUfreq
but shocking had been the difference when running intel p-states with performance -> 25W
and the old kernel on the same machine - or the new kernel with 'intel_pstate=passive' and CPUfreq set to ondemand did just use -> 22W
this was 12% more energy -> 24/7/365 with intel p-states - just to stay in idle the most time ....
After some more research and tuning, I realized it's better to change the plan than the governor. So here is the updated /etc/pm/power.d/cpufreq script:
Code:
#!/bin/sh
# Default value on battery [$1 = "true"]
SCALING_PLAN_BAT="powersave"
# Default value on AC [$1 = "false"]
SCALING_PLAN_AC="balanced"
set_cpufreq() {
case $1 in
bat) SCALING_PLAN=$SCALING_PLAN_BAT;;
ac) SCALING_PLAN=$SCALING_PLAN_AC;;
esac
printf "Setting CPU frequency scaling plan to %s..." "$SCALING_PLAN"
/usr/local/bin/pstate-frequency -S -p $SCALING_PLAN
[ "$?" -eq 0 ] && echo Done. || echo Failed.
}
case $1 in
true) set_cpufreq bat;;
false) set_cpufreq ac;;
*) exit $NA;;
esac
exit 0
One more thing - since I reinstalled the system yesterday, and repeated all the steps described here, I noticed that cpu frequency scaling is not working until the TLP Linux Advanced Power Management (https://github.com/linrunner/TLP) is installed, despite the pstate-frequency being used.
Thanks for pointing that out! I could remove some udev rules I had to save juice while running on batteries.
According to this faq, battery threshold for newer TP models should be disabled or have only start one set. As my TP is a X250, it fells into that recommendation so I've set it to:
I'm focusing only on the Slackware forum and didn't see the Intel CPU Powersaving thread you started in Linux General.
You can disable the intel_pstate driver with a simple kernel boot parameter:
Code:
intel_pstate=disable
Then the kernel will pick the default (generic and old) acpi-cpufreq driver. But I wouldn't recommend it, because you'll loose some PM functionality, on the power saving side you could loose some deep PM states and on the performance side some frequency boosting.
There's also an autonomous PM system inside the Intel ME that is actually in control over the CPU PM regardless of the driver you're using.
In this pretty long thread you'll find some more info (look after my posts - I did provide a lot of references and docs): https://www.linuxquestions.org/quest...or-4175637326/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.