View previous topic :: View next topic |
Author |
Message |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Tue Apr 30, 2024 8:14 am Post subject: Laptop tools |
|
|
Hi,
my installation was migrated for years and maybe I'm based on obsolete tools. What is today required for mobile laptops in general?
I was always using app-laptop/laptop-mode-tools and it's still working. At least it does set harddrive parameters for spindown and dirty timeouts while today the laptop only has NVMe drives, /etc/laptop-mode/conf.d/intel_pstate.conf is throttling the CPU on battery. So it still sounds useful.
Last update was 1.74 - Sat Jul 18 19:10:40 IST 2020.
On IRC I read that laptop-mode-tools are not the modern way anymore. On Intel platforms sys-power/tlp would be used, and on AMD platforms sys-power/power-profiles-daemon would be used.
I looked around https://wiki.gentoo.org/wiki/Category:Laptops and only found model-specific Wikis, but no common Gentoo-on-laptops Wiki.
Which tools do I need today and for which generation and architecture?
For not dealing with that many modern kernel options and required firmwares I currently just run a distro-kernel sys-kernel/gentoo-kernel-bin and a complete sys-kernel/linux-firmware, using 1,1G /lib/firmware/ which is 583M usage by btrfs zstd compression. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2149
|
Posted: Tue Apr 30, 2024 10:07 am Post subject: |
|
|
What's the specific issue you're trying to solve? And yes, I haven't heard of laptop mode tools since 2010 when it still was a thing and I still had a ThinkPad. When I returned back to Linux in 2018 it was already outdated. Nowadays I personally don't use anything else other than power-profiles-daemon on my AMD laptop and I don't even think it does anything useful.
Best Regards,
Georgi
Last edited by logrusx on Tue Apr 30, 2024 1:05 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Tue Apr 30, 2024 11:05 am Post subject: |
|
|
As usual, saving power by throttling CPU, GPU, harddisks, frequencies, dirty cycles, displays, brightness, timeouts etc...
A lot of all that what laptop-mode-tools already do and still doing.
At least there have been updates to the project after your comeback. Beside that, I'm using Linux since 2003, never left and nothing else. All years before have been a waste of time. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Goverp Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/152613747847c6fd276c31a.jpg)
Joined: 07 Mar 2007 Posts: 2106
|
Posted: Tue Apr 30, 2024 12:19 pm Post subject: |
|
|
I use laptop tools. I last looked a couple of years ago, and it was still as good as anything else. Mostly you want to ensure your kernel and drivers have all the necessary low power modes supported, the right frequency driver (IIUC schedutil is what the kernel guys recommend), and the appropriate thermal drivers for your hardware. IIUC you're using a general-purpose kernel, so you should have those already. There's not much more for the tools to do than select the lower-energy settings when running on batteries, and laptop tools does that. IMHO steer clear of using hdparm or whatever to spin down disks, if you still have any - you can lose data, and spinning up a disk takes quite a bit of power compared with just keeping them spinning, so the saving isn't that large. Better, replace the disk with an SSD and your laptop will appear 10 times faster as well as consuming less power.
If you try the power monitoring tool (the proper one, I forget its name, but it's more detailed than the one built into desktop GUIs), you'll almost certainly find that top consumer is the cpu if running 100% (but usually it's idling), then the screen. All the rest tends to be minor, so once you have the frequency driver working, the next best way to save energy is to turn the screen off! _________________ Greybeard |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
logrusx Advocate
![Advocate Advocate](/images/ranks/rank-G-1-advocate.gif)
![](images/avatars/176594205966916859b5145.jpg)
Joined: 22 Feb 2018 Posts: 2149
|
Posted: Tue Apr 30, 2024 1:13 pm Post subject: |
|
|
Massimo B. wrote: | As usual, saving power by throttling CPU, GPU, harddisks, frequencies, dirty cycles, displays, brightness, timeouts etc...
A lot of all that what laptop-mode-tools already do and still doing.
At least there have been updates to the project after your comeback. Beside that, I'm using Linux since 2003, never left and nothing else. All years before have been a waste of time. |
Screen brightness I control myself and it doesn't depend on the battery. When I need more brightness, I need more brightness, period. My eyes do not care if the laptop is on battery power. The rest is already taken care of by the hardware nowadays. At least on AMD hardware. The only thing I remember explicitly doing, aside from switching to quiet profile(EFI firmware function, limits CPU frequency and boost), was to set the CPU frequency governor to powersave and it didn't substantially improve battery life.
However I have to admit there's an unknown amount of work systemd is doing for me in that regard. Also Gnome has a pretty good screen management with dimming it and turning it off.
Best Regards,
Georgi |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
xgivolari Tux's lil' helper
![Tux's lil' helper Tux's lil' helper](/images/ranks/rank_rect_1.gif)
Joined: 26 Jul 2021 Posts: 102
|
Posted: Tue Apr 30, 2024 3:57 pm Post subject: |
|
|
For most intents and purposes, TLP at default settings works very well. With newer laptops, it is important to ensure that S0ix/modern standby is working properly, and that the system is reaching lower runtime power states. You can use S0ixSelftestTool and powertop for that. If you are running GNOME or KDE, power-profiles-daemon integrates very nicely with these. However, it is neither as extensive as, nor compatible with TLP. Both work just fine on Intel and AMD systems. Additionally on intel, it is recommended to install thermald for better thermal/power management. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Jun 20, 2024 11:21 am Post subject: |
|
|
You mean, neither sys-power/tlp nor sys-power/power-profiles-daemon are architecture specific and both should work on Intel and AMD? And power-profile-daemon only integrates well when using KDE or Gnome?
I'm using Xfce, OpenRC (no systemd). So for all that systemd does for powersaving, I don't have that.
So I keep laptop-mode-tools for now, as it does not harm, mostly sets harddisk powersaving, usually not that important when using SSDs.
What else I need, tlp, power-profiles-daemon?
I started with powertop. On some old Ivy Bridge desktop, it doesn't work, eventhough the kernel seems to have that all: Code: | # powertop
modprobe cpufreq_stats failed
Failed to mount debugfs!
exiting...
# zgrep -i -e cpufreq -e debugfs /proc/config.gz
CONFIG_ACPI_EC_DEBUGFS=y
CONFIG_X86_PCC_CPUFREQ=m
# CONFIG_X86_ACPI_CPUFREQ is not set | ... but not important on a desktop.
On a mobile Tigerlake, powertop finds a lot of Tunables marked as "Bad". Most of them switch to "Good" when disconnecting power supply. The only 2 remaining bad are "VM writeback timeout" and "Enable Audio codec power managment", which I could manually toggle, receiving this: Code: | >> echo '1500' > '/proc/sys/vm/dirty_writeback_centisecs';
>> echo '1' > '/sys/module/snd_hda_intel/parameters/power_save'; |
_________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Jun 20, 2024 11:27 am Post subject: |
|
|
Next one, testing tlp. The project sounds good and modern, applying quite the same as powertop --auto-tune would do:
Code: | # tlp start
***Warning: laptop-mode-tools detected, this may cause conflicts with TLP.
Please uninstall laptop-mode-tools.
TLP started in AC mode (auto). |
Ok, that at least conflicts with laptop-mode-tools and features might overlap.
Anyway, I just disabled the laptop-mode-tools daemon for now.
But doing a tlp start makes the system unusable slow, not responding anymore. No tlp ac or tlp bat solves it. Only disconnecting AC power and connecting again makes it work again.
In the syslog I noticed some Code: | Jun 20 13:29:12 [kernel] [13146.366090] NOHZ tick-stop error: local softirq work is pending, handler #08!!! |
Doing a rc-service tlp start does not show that issue.
Time to file a bug report for tlp...: https://github.com/linrunner/TLP/issues/745 _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Wed Jul 10, 2024 10:29 am Post subject: |
|
|
Ok, solved by Code: | USB_DENYLIST="0bda:8153" | for the network device.
How does TLP recognize ac->bat or bat->ac switches? Old app-laptop/laptop-mode-tools did that, but needed to be uninstalled for tlp now. Starting the /etc/init.d/tlp service via OpenRC doesn't start any daemon but only runs aDo I need to configure something else? _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Jul 18, 2024 10:28 am Post subject: |
|
|
xgivolari wrote: | Additionally on intel, it is recommended to install thermald for better thermal/power management. | After tlp is running fine now, I'm going to check thermald.
At least https://linrunner.de/tlp/faq/installation.html#does-tlp-conflict-with-other-power-management-tools says:
Quote: | thermald: limits power dissipation to prevent the laptop from overheating. It does not provide power saving functionality for other situations and therefore does not conflict with TLP. |
However in the logs I see:
[1721298692][MSG]Config file /etc/thermald/thermal-conf.xml does not exist
After moving the installed /etc/thermald/thermal-cpu-cdev-order.xml to /etc/thermald/thermal-conf.xml, the message is gone. Maybe worth a bug report? _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Aug 01, 2024 11:42 am Post subject: |
|
|
Using TLP now as default on Laptops, does it make any sense to use it on Desktop machines which are always running in AC mode? Actually even when using the AC mode only, TLP has a lot of configuration there. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Banana Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/5204386264b863c6da7ffb.jpg)
Joined: 21 May 2004 Posts: 1618 Location: Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Aug 01, 2024 12:52 pm Post subject: |
|
|
It does. You can add some powersaving even in AC mode, which could be also interesting for AC-only machines:
https://linrunner.de/tlp/support/optimizing.html#opt-reduce-power-on-ac
I wouldn't need it so far, my machine isn't overheating, so I like to take most of the available power. And pstate already does a good powermanagement without keeping the CPU at max performance all the time. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Banana Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/5204386264b863c6da7ffb.jpg)
Joined: 21 May 2004 Posts: 1618 Location: Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Thu Aug 15, 2024 11:12 am Post subject: |
|
|
Something else. What is responsible to do some emergency shutdown on low battery? I remember vaguely that some of all these frameworks was able to do some emergency shutdown or suspend to disk on critical battery level...
In old laptop-mode-tools that I already removed, there was at least DISABLE_LAPTOP_MODE_ON_CRITICAL_BATTERY_LEVEL=1, not a real shutdown but some sort of sync before the system is dying. On TLP I don't see anything like that. Recently I ran out of battery and there was nothing about it in the logs, which seems to be no shutdown but no sync to logfiles either.
EDIT: I've forwarded that question to https://github.com/linrunner/TLP/issues/755 …but still no reply there. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Banana Moderator
![Moderator Moderator](/images/ranks/rank-mod.gif)
![](images/avatars/5204386264b863c6da7ffb.jpg)
Joined: 21 May 2004 Posts: 1618 Location: Germany
|
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Tue Aug 20, 2024 6:53 am Post subject: |
|
|
This system critical feature should be working without the DE, as well as other things like screen powermanagement and dimming. Often I power on the laptop for automatic backups and remote maintenance only, without logging in any DE.
Currently, Xorg already seems to power off the screen after a while, that's sufficient. Dimming does not work without the DE. _________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sublogic Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/92700334162390783722aa.png)
Joined: 21 Mar 2022 Posts: 264 Location: Pennsylvania, USA
|
Posted: Tue Aug 20, 2024 9:39 pm Post subject: |
|
|
Maybe sys-power/acpid ? Back around 2005 I had a laptop using that, through a script at /etc/acpi/default.sh . No desktop environment back then, just X with ctwm as the window manager.
I don't remember if it could monitor battery levels, but it's worth a look. Also, I don't know if there are conflicts when you also run a desktop environment. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
flexibeast Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 04 Apr 2022 Posts: 375 Location: Naarm/Melbourne, Australia
|
Posted: Wed Aug 21, 2024 1:00 am Post subject: |
|
|
sublogic wrote: | I don't remember if it could monitor battery levels |
It can: cf. acpi(1). i call `acpi -b` in a script i've written which gives me desktop notifications warning about things like battery levels, memory usage, etc. |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Massimo B. Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/1411393680427a4354494d7.gif)
Joined: 09 Feb 2005 Posts: 1805 Location: PB, Germany
|
Posted: Mon Aug 26, 2024 7:18 am Post subject: |
|
|
I guess it's rather sys-power/upower: Code: | # grep -v "^#" /etc/UPower/UPower.conf |grep -v "^$"
[UPower]
EnableWattsUpPro=false
NoPollBatteries=true
IgnoreLid=false
UsePercentageForPolicy=true
PercentageLow=10
PercentageCritical=5
PercentageAction=2
TimeLow=1200
TimeCritical=300
TimeAction=120
CriticalPowerAction=PowerOff |
_________________ HP ZBook Power 15.6" G8 i7-11800H|HP EliteDesk 800G1 i7-4790|HP Compaq Pro 6300 i7-3770 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
Spargeltarzan Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 23 Jul 2017 Posts: 319
|
Posted: Tue Sep 03, 2024 7:26 am Post subject: |
|
|
I use tlp many years now and it works pretty fine, I didn't notice any issues.
Work through
it describes features already quite good. For more details, look at https://linrunner.de/tlp/settings/introduction.html
Be aware that CPU governers have noadays no real usage with Intel p-state active mode (you should check if it is available for your CPU); set it therefore to performance or powersave. It doesn't have any consequences - most distros default to powersave. So did I.
You don't need to start tlp from terminal, just add it to your runlevel after working on the config file.
Once you are done, you can forget about it.
KDE provides support for power-profiles-daemon. It supports profiles like "powersave", "balance" and "performance", similiar to Windows. But it is documented that TLP actually provides better battery saving features. If you use TLP, remove power-profiles-daemon from your runlevel. KDE notifies that profiles are not available; power-profiles-daemon is not running.
I don't use acpid or other traditional, maybe dated features. _________________ ___________________
Regards
Spargeltarzan
Notebook: Lenovo YOGA 900-13ISK: Gentoo stable amd64, GNOME systemd, KVM/QEMU
Desktop-PC: Intel Core i7-4770K, 8GB Ram, AMD Radeon R9 280X, ZFS Storage, GNOME openrc, Dantrell, Xen |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|