You are not logged in.
I just got a new laptop and I'm currently looking into my powersaving script again to see how much battery life I can squeeze out. I'm reading up on alot of things and just came across three different methods to achieve the same, e.g. enable powersaving:
1. You can pass the options through modprobe at boot;
2. You can pass the options directly to the kernel at boot;
3. You can set them at runtime
For example, USB autosave can be enabled in either of the following methods:
1. /etc/modprobe.d/usbcore.conf
options usbcore autosuspend=1
2. Kernel boot options (ie. in grub's menu.lst):
usbcore.autosuspend=1
3. At runtime, per device, with:
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
for i in /sys/bus/usb/devices/*/power/level; do echo auto > $i; done
Now I'm curious, which way do you prefer and why? I think I would prefer setting them all at runtime, just so I have all the different options (including those that can not be set by modprobe or directly at the kernel) grouped together in a script - but perhaps you can convince me of the better way!
EDIT: Oh, and of course there also are udev rules! Of course, kernel parameters and modprobe values do not enable toggling, so these might be less favored.
Last edited by Unia (2013-09-23 19:21:35)
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I use powerdown. It installs a udev rule that runs that appropriate scripts when you plug/un-plug AC power. I've modified the scripts heavily since there are a few things that I've disabled/set permanently (audio powersave, bluetooth, webcam etc). Powerdown pretty much sets my screen brightness automatically now.
Offline
Powerdown uses a mixture of every method I described above -- and I suggested those udev rules to Taylorchu
If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Offline
I use a mix of both kernel boot options and TLP. If the device is kernel dependent then I use boot option. If device belongs in userland then I go with TLP or similar script. If you depend on kernel and boot option that may or may not require you to reboot whereas power scripts like TLP may only need to be reloaded.
Offline
Mixture of kernel parameters on the command line, modprobe at boot and runtime via laptop-mode-tools.
Command line:
i915.i915_enable_rc6=-1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 i915.semaphores=1
modproble:
options snd-hda-intel model=thinkpad power_save=1
And the rest is laptop-mode-tools according to whether I'm on battery or AC etc. KDE also does a little bit like dimming the screen but mostly I rely on laptop-mode-tools.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
I just set all things to be power saving through a mixture of udev rules and modprobe.d options.
I tried using tlp, powerdown, and laptop-mode-tools, and I honestly didn't see much (if any) difference in performance whether the computer was plugged in or not. So I figured why have these things changing all the time, for no real benefit. Granted, I don't do anything super resource intensive with my system, and I have a fairly powerful Intel Core i5 3210M. It is not amazingly powerful, but it sported all the nice processor features I wanted, and is far more than enough for my expectations of the machine.
I imagine if you spend all your time benchmarking, or rendering massive video projects, squeezing every ounce of power out of the machine would be more appropriate. But I honestly think that for a majority of users, it shouldn't be necessary to change these things whatsoever.
Offline
@WonderWoofy: could you share your settings?
Offline
Honestly, I just did what powertop told me to do. So, at the time, I just googled things one by one, but I have since found out that you can output an html file from powertop that will tell you what to write to which files in order to set them to to "good".
It highly depends on your system and what modules and hardware you have. So it is rather pointless to simply copy and paste the numerous configurations here. But in general, if the option/file shown by powertop is a in /sys/module typically there is a parameter that can be set when the module loads. So in those cases, you can use /etc/modprobe.d. For the others, you can typically just use udevadm to do an attribute walk and get a few parameters to individualize a given setting, and then of course set the actual file in question.
Here is an example of what I use to set the satalink power management:
ACTION=="add", KERNEL=="host*", SUBSYSTEM=="scsi_host", SUBSYSTEMS=="scsi", ATTR{link_power_management_policy}="min_power"
Module parameters should be fairly obvious how to set as well if you are willing to read the man page. But here is an example of the snd_hda_intel module's powersave function:
% cat /etc/modprobe.d/snd_hda_intel.conf
options snd_hda_intel powersave=1
I guess the only other thing that I forgot to mention was a few sysctl.d (formerly sysctl.conf) settings that are recommended by powertop as well. I know off the top of my head that it recommends you set /proc/sys/vm/laptop_mode to '5'.
Offline
I think the changes are useful for some things. For example, there are some things I never use when not plugged in (or I'm prepared to fiddle in the very rare exceptions to that rule): output to external monitor, bluetooth, ethernet. Also, I'm prepared to work with a slightly darker screen than I find optimal and to risk losing slightly more work in exchange for extended battery life. And I also use wifi on a lower power setting on battery. So although I agree for some things (e.g. I set the powersave for snd_hda_intel in the same way), I think for others, there's a case to be made. But it does depend on your usage. Obviously, if you do presentations on battery, you don't want to disable VGA out. Or if you need to connect with your mobile phone on battery, you won't want bluetooth disabled. So I can see that there might be little point for some people, even though there is for me.
CLI Paste | How To Ask Questions
Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L
Offline
Heh, I just install and enable laptop-mode-tools and forget about it. I'm too lazy to do more.
If it ain't broke, you haven't tweaked it enough.
Offline