LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-16-2019, 12:13 PM   #1
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Rep: Reputation: 40
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.
 
Old 07-16-2019, 12:52 PM   #2
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Read /etc/rc.d/rc.cpufreq , does it apply to your case?
 
1 members found this post helpful.
Old 07-16-2019, 01:04 PM   #3
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,160

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
Code:
dd if=/dev/zero of=zero2 bs=1M count=1024
This only gives the time until the writes have completed (data still in RAM). If you want to measure writes all the way to disk do:

Code:
dd if=/dev/zero of=zero2 bs=1M count=1024 oflag=direct
 
2 members found this post helpful.
Old 07-17-2019, 09:19 AM   #4
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
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
means that performance governor is always used.

I also installed TLP, and here is the output from tlp-stat: https://pastebin.com/512j9Ru9

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.
 
1 members found this post helpful.
Old 07-17-2019, 09:37 AM   #5
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by ajevremovic View Post
means that performance governor is always used.
You should change to "ondemand".

Also try run "powertop" to see what process/hardware use most of power.
 
Old 07-17-2019, 09:40 AM   #6
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,007
Blog Entries: 26

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Quote:
Originally Posted by ajevremovic View Post
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
means that performance governor is always used.

I also installed TLP, and here is the output from tlp-stat: https://pastebin.com/512j9Ru9

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.
 
Old 07-17-2019, 10:09 AM   #7
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Labinnah View Post
You should change to "ondemand".

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?)
 
Old 07-17-2019, 10:15 AM   #8
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Timothy Miller View Post
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 View Post
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.
 
Old 07-17-2019, 10:18 AM   #9
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, EndeavourOS, OpenSUSE, KDE Neon
Posts: 4,007
Blog Entries: 26

Rep: Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522Reputation: 1522
Quote:
Originally Posted by ajevremovic View Post
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.
 
Old 07-17-2019, 11:00 AM   #10
lamerix
LQ Newbie
 
Registered: Mar 2018
Location: Bulgaria
Distribution: Slackware
Posts: 27

Rep: Reputation: Disabled
Ops

Last edited by lamerix; 07-17-2019 at 11:01 AM. Reason: already said.sorry saw it a bit late
 
Old 07-17-2019, 11:26 AM   #11
Labinnah
Member
 
Registered: May 2014
Location: Łódź, Poland
Distribution: Slackware-current
Posts: 185

Rep: Reputation: 112Reputation: 112
Quote:
Originally Posted by ajevremovic View Post
And here is the output from "powertop": https://pastebin.com/k4z4Xtr6 (I'm not sure how to interpret the results?)
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.
 
Old 07-17-2019, 11:49 AM   #12
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by Labinnah View Post
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:
Code:
PowerTOP v2.10    Overview   Idle stats   Frequency stats   Device stats   Tunables   WakeUp                            


            Package |             Core    |            CPU 0	   CPU 4
                    |                     | Average   3.8 GHz     3.7 GHz
Idle                | Idle                | Idle
 400 MHz            |  400 MHz            |  400 MHz
4.00 GHz            | 4.00 GHz            | 4.00 GHz

                    |             Core    |            CPU 1	   CPU 5
                    |                     | Average   3.8 GHz     3.8 GHz
                    | Idle                | Idle
                    |  400 MHz            |  400 MHz
                    | 4.00 GHz            | 4.00 GHz

                    |             Core    |            CPU 2	   CPU 6
                    |                     | Average   3.8 GHz     3.8 GHz
                    | Idle                | Idle
                    |  400 MHz            |  400 MHz
                    | 4.00 GHz            | 4.00 GHz

                    |             Core    |            CPU 3	   CPU 7
                    |                     | Average   3.8 GHz     3.7 GHz
                    | Idle                | Idle
                    | 4.00 GHz            | 4.00 GHz
                    |  400 MHz            |
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
 
Old 07-17-2019, 12:50 PM   #13
phenixia2003
Senior Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008Reputation: 1008
Hello,

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.

--
SeB
 
1 members found this post helpful.
Old 07-17-2019, 01:12 PM   #14
ajevremovic
Member
 
Registered: May 2011
Location: Serbia
Posts: 82

Original Poster
Rep: Reputation: 40
Quote:
Originally Posted by phenixia2003 View Post
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!
 
3 members found this post helpful.
Old 07-17-2019, 04:49 PM   #15
tramtrist
Member
 
Registered: Jul 2018
Location: Cincinnati USA
Distribution: Slackware
Posts: 550

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Thinpads - T480/T580, etc CPU throttling SqdnGuns Slackware 0 06-15-2018 06:45 AM
Set Clock Frequency on a Frequency Scaling Disabled Kernel mobin.seven Linux - Kernel 3 02-18-2017 10:33 PM
moved harddrive from t61 lenovo to t60 lenovo, now cpu freezes Peter Shepard Ubuntu 3 10-26-2009 06:11 PM
cpu frequency scaling with Pentium(R) Dual-Core CPU E5200 @ 2.50GHz tramni1980 Slackware 5 08-16-2009 08:29 AM
Curious to hear other people's experiences of the Thinkpad 240x nowhere.elysium Linux - Laptop and Netbook 1 01-15-2009 12:20 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 01:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration