Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Laptop tools
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Tue Apr 30, 2024 8:14 am    Post subject: Laptop tools Reply with quote

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
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2435

PostPosted: Tue Apr 30, 2024 10:07 am    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Tue Apr 30, 2024 11:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2179

PostPosted: Tue Apr 30, 2024 12:19 pm    Post subject: Reply with quote

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
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2435

PostPosted: Tue Apr 30, 2024 1:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
xgivolari
Tux's lil' helper
Tux's lil' helper


Joined: 26 Jul 2021
Posts: 102

PostPosted: Tue Apr 30, 2024 3:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Jun 20, 2024 11:21 am    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Jun 20, 2024 11:27 am    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Wed Jul 10, 2024 10:29 am    Post subject: Reply with quote

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 a
Code:
tlp init start
Do 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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Jul 18, 2024 10:28 am    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Aug 01, 2024 11:42 am    Post subject: Reply with quote

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
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1739
Location: Germany

PostPosted: Thu Aug 01, 2024 12:04 pm    Post subject: Reply with quote

AS far as I understand the docs, tlp does "nothing" when in AC mode. So you need to configure it to work woth the constant power on mode and not having a battery.
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Aug 01, 2024 12:52 pm    Post subject: Reply with quote

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
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1739
Location: Germany

PostPosted: Fri Aug 02, 2024 8:49 am    Post subject: Reply with quote

Massimo B. wrote:
It does. You can add some powersaving even in AC mode,

This is why I put the nothing in quotes :-)
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Thu Aug 15, 2024 11:12 am    Post subject: Reply with quote

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
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1739
Location: Germany

PostPosted: Mon Aug 19, 2024 2:32 pm    Post subject: Reply with quote

Your DE should be able to handle it.

There is also a DE independent way: https://superuser.com/questions/1057868/shutdown-a-linux-computer-depending-on-the-battery-level or udev rule https://wiki.archlinux.org/title/Laptop#Hibernate_on_low_battery_level
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Tue Aug 20, 2024 6:53 am    Post subject: Reply with quote

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
View user's profile Send private message
sublogic
Apprentice
Apprentice


Joined: 21 Mar 2022
Posts: 270
Location: Pennsylvania, USA

PostPosted: Tue Aug 20, 2024 9:39 pm    Post subject: Reply with quote

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
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 452
Location: Naarm/Melbourne, Australia

PostPosted: Wed Aug 21, 2024 1:00 am    Post subject: Reply with quote

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
View user's profile Send private message
Massimo B.
Veteran
Veteran


Joined: 09 Feb 2005
Posts: 1810
Location: PB, Germany

PostPosted: Mon Aug 26, 2024 7:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Spargeltarzan
Guru
Guru


Joined: 23 Jul 2017
Posts: 325

PostPosted: Tue Sep 03, 2024 7:26 am    Post subject: Reply with quote

I use tlp many years now and it works pretty fine, I didn't notice any issues.

Work through
Code:
 /etc/tlp.conf

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum