You are not logged in.

#1 2013-09-23 19:04:42

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,469
Website

So, which method of powersaving do You prefer?

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

#2 2013-09-23 19:57:17

cris9288
Member
Registered: 2013-01-07
Posts: 345

Re: So, which method of powersaving do You prefer?

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

#3 2013-09-23 19:59:03

Unia
Member
From: The Netherlands
Registered: 2010-03-30
Posts: 2,469
Website

Re: So, which method of powersaving do You prefer?

Powerdown uses a mixture of every method I described above -- and I suggested those udev rules to Taylorchu wink


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

#4 2013-09-24 04:53:46

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: So, which method of powersaving do You prefer?

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

#5 2013-10-04 02:37:06

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: So, which method of powersaving do You prefer?

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.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#6 2013-10-04 02:59:22

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: So, which method of powersaving do You prefer?

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

#7 2013-10-04 23:55:59

el mariachi
Member
Registered: 2007-11-30
Posts: 587

Re: So, which method of powersaving do You prefer?

@WonderWoofy: could you share your settings?

Offline

#8 2013-10-05 00:11:29

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: So, which method of powersaving do You prefer?

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

#9 2013-10-05 02:04:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 5,661

Re: So, which method of powersaving do You prefer?

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.


How To Ask Questions The Smart Way | Help Vampires

Arch Linux | x86_64 | GPT | EFI boot | grub2 | systemd | LVM2 on LUKS
Lenovo x121e | Intel(R) Core(TM) i3-2367M CPU @ 1.40GHz GenuineIntel | Intel Centrino Wireless-N 1000 | US keyboard with Euro | 320G 7200 RPM Seagate HDD

Offline

#10 2013-10-13 17:22:17

mid-kid
Member
Registered: 2013-05-07
Posts: 177

Re: So, which method of powersaving do You prefer?

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

Board footer

Powered by FluxBB