PowerTOP – diagnose issues with power consumption and power management on Linux
01.org
01.org
# tlp-stat
defaults.conf L0019: SATA_LINKPWR_ON_AC="med_power_with_dipm max_performance"
defaults.conf L0020: SATA_LINKPWR_ON_BAT="med_power_with_dipm min_power"Anyways, when it was new I kinda-sorta became obsessed about battery life and I tried all the tricks: Screen on minimum brightness, wifi and bluetooth disabled, SSD installed, all the options toggled in PowerTOP and tlp-stat[0], I could get that i7 down to just 6 Watts or so at idle, but of course even the interrupts from the keyboard would cause the power consumption to spike upwards. At 6 Watts it would last something like 9 hours, which is great when you're traveling. Pre-download a bunch of API documentation and man pages, and you can hack away on the plane.
Powertop is a great tool that's only been getting better.
I of course do not use that laptop any more; I gave it to my 4 year old daughter and taught her how to launch emacs. She plays a game where she makes fun letter patterns in the scratch buffer and I use a macbook pro as my daily driver. The battery life is substantially better, and I can't wait to try an M1. My wife's XPS can't hold a candle to the macbook as far as longevity is concerned.
Not sure Peppa Pig is really the program to wow someone with 4k.
https://www.theverge.com/2020/6/29/21307620/apple-mac-netfli...
But when I last did, I just installed tlp which now mostly incorporates every suggestion from powertop anyway.
I have the opposite experience. The only non-Linux machine in my office is a MBP from my employer which I feel gets in my way far more.
- laptop wakes up randomly when lid is closed, fans spin up, drain battery
- wifi is flaky
- trackpad drivers/trackpad behavior in general are inferior
- battery life isn't as good even with obsessive levels of tweaking
There's a project underway to delivers a better touchpad experience on Linux, but that's still a work in progress as far as I know. It also strongly depends on how much details the manufacturers disclose about their hardware, how willing they are to open source their drivers and how much they rely on copyrighted binary blobs of firmware. From what I've read about the Mac hardware, it's probably going to be a challenge to get everything running smoothly. Synaptics hardware, found in many laptops, isn't always much better in this regard.
Apple applies some very optimised CPU power profiles to their laptops, which aren't directly available to other operating systems. It's why Windows consumes more power on Macbooks as well, and why the fans (if present) kick in more often.
I have noticed that my Thinkpad lasts a lot longer on Linux than on Windows unless I turn the power settings down to the point where Windows' UI becomes janky. It really depends on the year, model and serial number of each laptop whether Linux will boost or degrade the performance and usability aspects of the device. Manufacturers that sell Ubuntu as an OS option seem to do well in this area, though.
I'm hopeful for what the Linux touchpad project will bring. The new GNOME releases and the recent updates to the Pop_OS window manager seem to put more of an emphasis on touchpads, so things are moving in the right direction.
Everything in that list was from my ThinkPads, of which I own several.
The trackpad is smooth enough after I adjust the trackpad speed. It is slow as molasses by default. What is disappointing is the lack of multitouch support. Gnome 40 and the lastest Pop OS have some nice multitouch features for the desktop but support in applications is practically non existent.
I will agree though that the one thing I find much better on Apple laptops is the trackpad. I do disable the trackpad and use the nub, which I find more convenient for most things anyway.
I was running a super ancient Linux distro on this laptop for years, and had two weird incidents. In one, I was trying to tweak power settings manually, and somehow got the CPU fan stuck on "full-speed" for something like 6 months. Then later I installed either PowerTOP or TLP or some other tool I don't know, and it recalibrated my power settings.... immediately the fan stopped going full-speed, and it would only turn on when the CPU was really chugging.
Fast forward to today, I upgraded to Ubuntu 20.04. Just letting the machine idle after boot-up runs the CPU fan continuously at low speed. Opening a browser sends it into full-speed mode until I close the browser (virtually any page). But it's the same machine, and same version of Firefox. So, something about this newer kernel + OS has resulted in the fan spinning way more than the old kernel + OS. Trying to figure out how or why leads you nowhere, because of course it's all specific to your hardware and whatever in the kernel has changed.
Now you might think, "OK, just turn on power-saving, the fans should be silenced." Nope. Tried every single power tweak that exists, and I can't force the fans to quiet. I can make the CPU run dog slow, but the fans keep chugging. Which is really annoying when all you want is a few minutes of peace and quiet.
If it's not that, check that the temps are actually high. If they are not, adjusting the fan curve could be possible. https://wiki.archlinux.org/title/Fan_speed_control lists some options (nbfc looks nice and is new to me), your laptop might have some vendor specific solution like thinkfan.
I'm not surprised that there's regressions, but I am a little surprised at how poor the hardware compatibility testing is (I guess there isn't any?). The only way to know for sure if a complete system will keep working when the software changes is to test it, send test results in, look for bugs, fix those, etc. It's surprising that Linux has been developed for 30 years and there's no official test suite for hardware compatibility. All of us should be running a test suite that automatically sends reports back to the kernel devs, but for whatever reason Linus's testing model is "put out an alpha release and see if anybody complains". And there's virtually no documentation for 90% of the controls in the kernel; you have to be a kernel hacker to know what values to set on what controls and what they'll even do.
Though some things get better with time, gpu acceleration for videos in the browser is possible now in Linux in general and works well, maybe it even works with that old gpu.
For this specific issue: If the fans do not spin down when the processor clocks down the thermal control of the laptop is broken. If that worked better in earlier systems, then it wasn't BIOS controlled then but is now, or the other way around. I'd really look at whether nbfc supports it. And also at what is possible in the BIOS, a Skylake laptop with UEFI bios might have a configurable fan curve.
And I'd also check what the temperature sensors output, this issue might be caused by simply more dust in the machine than it had earlier. Or, I once had the effect of my system being louder after a move, until I realized the system was equally noisy, my environment got quieter. It's easy to be wrong with those things.
I am curious: why do you have a throwaway account for posting this?
Edit: is that machine even able to run another OS than Linux? If not Linux is awesome and can even run on that machine :)
That concurs with my experience also.
As it turns out, turning off unused peripherals like HDMI and ethernet save you more battery than any tweaks you can do.
Anyway, around Linux 5.00 my old laptops battery life went from 2-3 hours to 6-7 and I haven't touched powertop since then.
Just an anecdote: I'm using Linux on a professional laptop, the same most of my colleagues use with Windows 10 (Latitude 7490). My battery life is significantly higher, high enough that I never care really, and the laptop is quieter: hearing the fan is the exception, not the norm.
All this with Debian and the TLP package installed. The TLP configuration is just tweaked to aggressively idle the SSD (no spin down / spin up issue anymore) but that's it. I did this a long time ago when I moved from HDD to SSD, and just carry this over.
A good deal of the difference may come from the antivirus on Windows, but TBC.
I even discovered that if limit the CPU to an small enough value (e.g. 0.1W, not that it’s actually capable of going that low), it reduces the clock speeds to 400MHz (compared to its usual baseline of 1.2GHz, which is still the baseline even when limited to 5W). The system certainly feels much slower with all cores at 400MHz than it does with all cores at 4GHz! But still quite usable in general.
¹ e.g. `ryzenadj -a 5000 -b 5000 -c 5000` for roughly a 5W TDP.
² From schedutil to powersave: `echo powersave | sudo tee /sys/devices/system/cpu/cpufreq/policy*/scaling_governor >/dev/null`
There's info scattered around on the internet for how to do this; I don't have my script to do this easily accessible atm.
I do concur on the governor's though, nothing else really makes much of a different. My old HP laptop I permanently had on the powersave scheder and it would draw about 2.5W - the battery life was stupidly ridiculous. My new AMD Lenovo I can't even get below 6W by the same method unfortunately.