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.
Lenovo ThinkPad T480 and Slackware - experiences and CPU frequency problem
Hi guys,
few days ago I god my new t480, with these characteristics:
14.0" FHD (1920 x 1080) 250 nits, IPS anti-glare
32 GB (16 + 16) DDR4 2400MHz
Integrated Intel® UHD Graphics 620
512 GB Solid State Drive, PCIe-NVMe OPAL2.0 M.2
3 cell Li-Ion 24Wh + 6 cell Li-Ion 72Wh
So, the Slackware (current) installation (from USB stick) went fine, elilo installed automatically (I had to disable Secure boot in setup). The NVMe drive and memory are really fast - I got these values:
RAM drive:
Code:
bash-5.0$ dd if=/dev/zero of=zero bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.211028 s, 5.1 GB/s
NVMe drive:
Code:
bash-5.0$ dd if=/dev/zero of=zero2 bs=1M count=1024
1024+0 records in
1024+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 0.406796 s, 2.6 GB/s
All hardware is supported out of the box (except CPU, more information in next paragraph). The only thing I had to change was the dhcp-client in /etc/NetworkManager/conf.d/00-dhcp-client.conf, from dhcpcd to dhclient, because the connection was breaking efter two seconds on some access points.
I enabled "Thunderbolt BIOS Assist Mode" in the Setup, as it should improve battery life. (Some people bricked their laptops when changing this option, but my t480 was fine with that.)
The battery life looks good, but I have a problem/question about this - when booted from USB stick, CPU frequency is scaling. However, after the installation (when booted from the drive) the CPU frequency (got from 'cat /proc/cpuinfo') is always at (turbo) maximum - 4GHz. I also installed this tool: https://github.com/erpalma/throttled but I see no change with this behavior.
The thing is that the CPU temperature is fine, ~48 degrees, and the fan is not working until there is some real load. However, I'm not sure what is causing the CPU to work (?) on the maximum frequency all the time, and I don't know if this is decreasing battery life?
Do you have any experience/idea about this?
Best,
Aleksandar
Last edited by ajevremovic; 07-16-2019 at 12:32 PM.
Read /etc/rc.d/rc.cpufreq , does it apply to your case?
Hi Eric, I checked /etc/rc.d/rc.cpufreq, but this part:
Code:
# For CPUs using intel_pstate, always use the performance governor. This also
# provides power savings on Intel processors while avoiding the ramp-up lag
# present when using the powersave governor (which is the default if ondemand
# is requested on these machines):
if [ "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2> /dev/null)" = "intel_pstate" ]; then
SCALING_GOVERNOR="performance"
fi
Actually, the battery is draining a much faster than it should - it lasts ~6-7 hours, which is not even a 1/3 of what is expected/advertised.
By the way, there is an unexpected behavior - the system uses built-in battery first, and then external one. Which has no sense, because I can't hot-replace the external one without shutting down the system.
smallpond, thank you for the tip about the NVMe benchmarking. Now it is 1.3GB/s, which is also very nice:
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, 0.820849 s, 1.3 GB/s
Last edited by ajevremovic; 07-17-2019 at 09:32 AM.
Hi Eric, I checked /etc/rc.d/rc.cpufreq, but this part:
Code:
# For CPUs using intel_pstate, always use the performance governor. This also
# provides power savings on Intel processors while avoiding the ramp-up lag
# present when using the powersave governor (which is the default if ondemand
# is requested on these machines):
if [ "$(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver 2> /dev/null)" = "intel_pstate" ]; then
SCALING_GOVERNOR="performance"
fi
Actually, the battery is draining a much faster than it should - it lasts ~6-7 hours, which is not even a 1/3 of what is expected/advertised.
By the way, there is an unexpected behavior - the system uses built-in battery first, and then external one. Which has no sense, because I can't hot-replace the external one without shutting down the system.
smallpond, thank you for the tip about the NVMe benchmarking. Now it is 1.3GB/s, which is also very nice:
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, 0.820849 s, 1.3 GB/s
Question for you. Does it ALWAYS default to having the onboard drain first? I have the A485 (basically the AMD powered version of your laptop), and if I boot it with the external battery removed then insert the external, it does EXACTLY as you describe. But if I leave it assembled and boot, then it drains correctly.
BTW - the reason I noticed this behaviour is because the A485 still seems to have a firmware issue where it drains both batteries when turned off, so I started removing the external battery if it was going to be stored off for more than a couple hours.
Also try run "powertop" to see what process/hardware use most of power.
I tried to change governor to "ondemand", but it is always automatically returned to "performance". And here is the output from "powertop": https://pastebin.com/k4z4Xtr6 (I'm not sure how to interpret the results?)
Question for you. Does it ALWAYS default to having the onboard drain first? I have the A485 (basically the AMD powered version of your laptop), and if I boot it with the external battery removed then insert the external, it does EXACTLY as you describe. But if I leave it assembled and boot, then it drains correctly.
In this 2-3 days I'm using it it always drains the built-in battery first. I will check what will happen if I boot without the external battery.
Quote:
Originally Posted by Timothy Miller
BTW - the reason I noticed this behaviour is because the A485 still seems to have a firmware issue where it drains both batteries when turned off, so I started removing the external battery if it was going to be stored off for more than a couple hours.
Yes, the built-in battery was drained to 5%, then the system switched to the external battery. But then, I left it in sleep mode, and when the laptop was awaken, the built-in battery was 0%.
I see no logic with this behavior, but I guess that removing/inserting battery all the time, on a laptop that costs ~$2000 is not a good marketing for Lenovo.
I see no logic with this behavior, but I guess that removing/inserting battery all the time, on a laptop that costs ~$2000 is not a good marketing for Lenovo.
NO, definitely not good marketing. And they seem to ignore their users. A bunch of us that bought the A485 have complained about it draining batteries when turned off, but so far Lenovo has utterly ignored us, not even acknowledging the issue still persists.
On this screen you can see what for and for how long processor was wake up. You can navigate to other screens by pressing TAB. You can analyze on them what device or process wakeup processor most often an next you can try do something with that. Take closer look to "Tunables" screen - here you can change some kernel parameter to better power saveings. But you must be careful with that - some changes may have unexpected results.
On first screen you have current power usage so you can see how your changes affect it.
I can't help you more in this. I've use this program very very long time ago; - I have very rarely occasion to use laptop on battery power so I don't interested with this program lately.
You can navigate to other screens by pressing TAB. You can analyze on them what device or process wakeup processor most often an next you can try do something with that. Take closer look to "Tunables" screen - here you can change some kernel parameter to better power saveings.
Thank you for pointing on this tool. However, it just confirmed that CPU is always working at near max (turbo) frequency:
and, on the Tunables screen everything looks fine:
Code:
>> Good VM writeback timeout
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP PCI Express Root Port #9
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP PCI Express Root Port #1
Good Wireless Power Saving for interface wlan0
Good Enable Audio codec power management
Good Bluetooth device interface status
Good Autosuspend for USB device xHCI Host Controller [usb2]
Good Autosuspend for USB device Integrated Camera [Azurewave]
Good Autosuspend for USB device EMV Smartcard Reader [Generic]
Good Autosuspend for USB device xHCI Host Controller [usb1]
Good Autosuspend for unknown USB device 1-7 (8087:0a2b)
Good Autosuspend for USB device USB3.0-CRW [Generic]
Good Runtime PM for I2C Adapter i2c-2 (i915 gmbus dpb)
Good Runtime PM for I2C Adapter i2c-3 (i915 gmbus dpd)
Good Runtime PM for I2C Adapter i2c-0 (SMBus I801 adapter at efa0)
Good Autosuspend for unknown USB device 1-9 (06cb:009a)
Good Runtime PM for I2C Adapter i2c-1 (i915 gmbus dpc)
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP PMC
Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v5/v6 / E3-1500 v5 / 6th/7th Gen Core Processor Gaussian Mixture Model
Good Runtime PM for PCI Device Intel Corporation Sunrise Point LPC Controller/eSPI Controller
Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Thermal Subsystem
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP CSME HECI #1
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP HD Audio
Good Runtime PM for PCI Device Intel Corporation Xeon E3-1200 v6/7th Gen Core Processor Host Bridge/DRAM Registers
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP PCI Express Root Port #11
Good Runtime PM for PCI Device Lite-On Technology Corporation Device 2300
Good Runtime PM for PCI Device Intel Corporation Wireless 8265 / 8275
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP Thermal subsystem
Good Runtime PM for PCI Device Intel Corporation Ethernet Connection (4) I219-V
Good Runtime PM for PCI Device Intel Corporation UHD Graphics 620
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP USB 3.0 xHCI Controller
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP SMBus
Good Runtime PM for PCI Device Intel Corporation Sunrise Point-LP PCI Express Root Port #7
You can set SCALING_GOVERNOR to powersave in /etc/default/cpufreq, and, if you want to go further with intel pstate, you can try pstate-frequency
Dear phenixia2003, I wasn't able to change SCALING_GOVERNOR in any way, including /etc/default/cpufreq. HOWEVER, looks like pstate-frequency tool did the job! CPU frequency is now changing, from ~900MHz to ~2.4GHz. I'll investigate this further (the most confusing part to me is that CPU frequency scaling was fine when booted from USB?), and will publish the conclusions here. Thanks!
I'm watching this one pretty closely .. Thanks for taking it on ajevremovic.. I'll probably load that pstate-frequency program tonight as well and test it out...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.