You are not logged in.

#1 2012-01-22 07:06:02

taylorchu
Member
Registered: 2010-08-09
Posts: 405

3x+ battery life

the result is amazing.

=before=
windows:~5hr
arch:~2hr

=after=
windows: ~5hr (this should be the same, tongue)
arch: 6hr+ (if you dont use flash)

package
1. powerdown in aur
3. xorg-xset (for dpms)

important
now, two options must be set in your boot parameter
1. pcie_aspm=force
2. i915.i915_enable_rc6=1

dpms optional

.xinitrc

# screen powersave
xset +dpms
xset dpms 0 0 300

Last edited by taylorchu (2012-05-31 23:37:19)


"After you do enough distro research, you will choose Arch."

Offline

#2 2012-01-22 08:10:25

milso
Member
Registered: 2010-11-16
Posts: 112
Website

Re: 3x+ battery life

What files are those exactly? Where do they belong?

Offline

#3 2012-01-22 08:22:45

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: 3x+ battery life

I assume the latter is a pm-powersave script, similar to the one in the wiki.

https://wiki.archlinux.org/index.php/Pm … wer_saving

Regards

Offline

#4 2012-01-22 08:30:56

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: 3x+ battery life

I have another one

for i in $(ls /sys/bus/usb/devices/*/power/level);do echo auto > $i;done

Offline

#5 2012-01-22 12:06:21

broken pipe
Member
Registered: 2010-12-10
Posts: 216

Re: 3x+ battery life

thanks for sharing!

hdparm -B 1: i don't know if it's recommendable but -B 1 can your wear out your disk. i would rather recommend an average value of 128, spinning up and down also needs lots of power. i keep it at 254 because i hate those noises.

maybe i overlooked it, but scaling down the monitor brightness saves A LOT of energy. even on my android device ~70% is 'wasted' by the screen

to improve the power consumption in my thinkpad i also disabled all unneeded devices in the bios (bluetooth, modem, cardreader, thinkfinger, cdrom). rfkilling or unloading the modules also works tongue

also make sure to disable Wake On Lan: ethtool -s eth0 wol d


ifyou want to put more things into your script: tongue
http://www.lesswatts.org
http://www.gentoo.org/doc/en/power-management-guide.xml
http://www.thinkwiki.org/wiki/How_to_re … onsumption
http://www.free-it.de/archiv/talks_2005 … tml#N100A5

Last edited by broken pipe (2012-01-22 12:26:17)

Offline

#6 2012-01-22 17:57:51

graysky
Member
From: /run/user/1000
Registered: 2008-12-01
Posts: 8,645
Website

Re: 3x+ battery life

@op - please edit your first post defining the location of the files.  I suspect one is /etc/conf.d/cpupower.conf


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2012-01-22 22:19:22

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

i revised the script a bit, and add screen dpms and backlight rules.
this script is intended to be the most complete script for linux powersaving.

@broken pipe
1. i think that is what -S does. it has nothing to do with -B.
2. can you list the modules?


"After you do enough distro research, you will choose Arch."

Offline

#8 2012-01-23 05:43:37

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: 3x+ battery life

A stupid question: How is this any different from laptop-mode-tools?

Offline

#9 2012-01-23 05:56:18

jocheem67
Member
Registered: 2009-11-09
Posts: 208

Re: 3x+ battery life

#!/bin/bash
#
#Power OFF nvidia card
cd /home/jochem/acpi_call
insmod acpi_call.ko
echo '\_SB.PCI0.PEG0.PEGP._OFF' > /proc/acpi/call &

#set wwan0 down
ifconfig wwan0 down &

#Enable Audio HD powersave
echo 1 > /sys/module/snd_hda_intel/parameters/power_save &

#Disable WOL
ethtool -s eth0 wol d &

#Enable multi core power savings
echo 1 > /sys/devices/system/cpu/sched_smt_power_savings &

#Enable laptop mode
echo 5 > /proc/sys/vm/laptop_mode &

#Set vm writeback to 10 secs (lose 10 secs on crash)
#echo 1500 > /proc/sys/vm/dirty_writeback_centisecs &

# Keep dirty writes in memory
echo 90 > /proc/sys/vm/dirty_ratio &
# Keep dirty writes out of cache
echo 1 > /proc/sys/vm/dirty_background_ratio &
# Writeback 60 secs
echo 6000 > /proc/sys/vm/dirty_writeback_centisecs &

# Swappiness
echo 9 > /proc/sys/vm/swappiness &

#maak bluetooth dood
rfkill block bluetooth
#/etc/init.d bluetooth stop

#kill nouveau
rmmod nouveau

#set scheduler
echo noop > /sys/block/sdb/queue/scheduler & 

#set aspm
echo powersave > /sys/module/pcie_aspm/parameters/policy sleep 60 &

#set wireless power
iwconfig wlan0 power on
iwconfig wlan0 power timeout 500ms

#runtime PM
for i in $(ls /sys/bus/{pci,i2c}/devices/*/power/control);do echo auto > $i;done

#powersaving /dev/sda
hdparm -B 1 -S 12 /dev/sda

#set scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu3/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu5/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu6/cpufreq/scaling_governor
#echo ondemand > /sys/devices/system/cpu/cpu7/cpufreq/scaling_governor
echo conservative | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
echo 1 > /sys/devices/system/cpu/cpufreq/conservative/ignore_nice_load 
echo -n 40 > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
echo -n 90 > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
#echo -n 10 > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor

#set SATA link power managment
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

exit

....works pretty well

Last edited by jocheem67 (2012-01-23 11:26:15)

Offline

#10 2012-01-23 06:06:27

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 13,405

Re: 3x+ battery life

jocheem67,
Please use BBCode Code tags.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
You assume people are rational and influenced by evidence.  You must not work with the public much. -- Trilby
----
How to Ask Questions the Smart Way

Offline

#11 2012-01-23 06:34:02

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

@jocheem67
thanks for reminding me "bluetooth".

@kcirick
i think the reason you asked is that you didnt give it a try.
laptop-tool barely saves me 30 minutes.

=compare=
before: ~2hr
laptop-mode-tools: 2.5~3 hr
my script: 6 hr.


"After you do enough distro research, you will choose Arch."

Offline

#12 2012-01-23 07:39:52

broken pipe
Member
Registered: 2010-12-10
Posts: 216

Re: 3x+ battery life

taylorchu wrote:

@broken pipe
1. i think that is what -S does. it has nothing to do with -B.
2. can you list the modules?

1. hdparm -S 6 = Wait 30sec (5*6) and then spindown? Correct me if i'm wrong
2. those modules can't be applied on any other laptop, but hwdetect can list a queue of modules (sound, usb, net, wlan, fw, irda) you might want to unload.

Offline

#13 2012-01-23 07:42:46

broken pipe
Member
Registered: 2010-12-10
Posts: 216

Re: 3x+ battery life

broken pipe wrote:
taylorchu wrote:

@broken pipe
1. i think that is what -S does. it has nothing to do with -B.
2. can you list the modules?

1. hdparm -S 6 = Wait 30sec (5*6) and then spindown? Correct me if i'm wrong
2. those modules can't be applied on any other laptop, but hwdetect can list a queue of modules (sound, usb, net, wlan, fw, irda) you might want to unload.

also disable watchdog and enable ac97 powersaving:
echo 0 > /proc/sys/kernel/nmi_watchdog
echo Y > /sys/module/snd_ac97_codec/parameters/power_save

mount the partitions using the noatime option

you could also include if/then checks to verify if the commands can be adapted on the hardware. otherwise the user gets a load of error messages big_smile

another trick:
http://www.cyberciti.biz/tips/linux-eth … aving.html

edit: sry double post

Last edited by broken pipe (2012-01-23 08:00:59)

Offline

#14 2012-01-23 11:48:13

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: 3x+ battery life

broken pipe wrote:

mount the partitions using the noatime option

relatime is the better option here iirc.

Offline

#15 2012-01-23 14:18:24

kcirick
Member
Registered: 2010-06-21
Posts: 364

Re: 3x+ battery life

taylorchu wrote:

@kcirick
i think the reason you asked is that you didnt give it a try.
laptop-tool barely saves me 30 minutes.

=compare=
before: ~2hr
laptop-mode-tools: 2.5~3 hr
my script: 6 hr.

You're right, I didn't actually try the scripts, but I asked because when I check the values you manually change, it is similar to what laptop-mode-tools do when it goes into the laptop-mode

These are what my laptop-mode-tools do:

$ cat /sys/module/pcie_aspm/parameters/policy 
[default] performance powersave 

$ cat /proc/sys/vm/laptop_mode
2

$ cat /proc/sys/vm/dirty_ratio 
60

$ cat /proc/sys/vm/dirty_background_ratio
1

$ cat /proc/sys/vm/dirty_writeback_centisecs 
60000

$ for i in /sys/bus/{pci,i2c}/devices/*/power/control; do cat $i; done
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto
auto

$ for i in /sys/bus/usb/devices/*/power/autosuspend; do cat $i; done
2
2
2
2
2
2

$ for i in /sys/bus/usb/devices/*/power/level; do cat $i; done
auto
on
auto
auto
auto
auto

$ for i in /sys/class/scsi_host/host*/link_power_management_policy; do cat $i; done
min_power

$ cat /sys/module/snd_hda_intel/parameters/power_save
2

$ cat /sys/module/snd_hda_intel/parameters/power_save_controller 
Y

The actual values are a little different (for example /proc/sys/vm/laptop_mode is 2 as opposed to 5 in your code), because that's what's in my /etc/laptop-mode/laptop-mode.conf. I can change it to whatever I want in there. My original question had to do with what these values really mean, I suppose... especially if the difference between laptop-mode and your script doubles the battery time (unless if I'm missing something/the point?)

Offline

#16 2012-01-23 16:20:36

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

pcie_aspm: +1~1.5hr!

I use more aggressive settings. For example /proc/sys/vm/dirty_ratio  is set to 90, it basically almost disable the feature to let program to write dirty data to the disk.
laptop_mode is how many sec to let your disk to go to idle state. I set it to 5 because linux doc recommends so.


"After you do enough distro research, you will choose Arch."

Offline

#17 2012-01-23 17:59:49

sandstorm
Member
From: Zurich [CH] & Mannheim [DE]
Registered: 2005-08-13
Posts: 152

Re: 3x+ battery life

Will you every transfer this information into the Wiki?

Offline

#18 2012-01-23 19:20:33

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: 3x+ battery life

sandstorm wrote:

Will you every transfer this information into the Wiki?

Second that!

This might be very useful since battery consumption was always a bit of lacky with default settings in Linux.

Regards

Offline

#19 2012-01-23 19:44:46

taylorchu
Member
Registered: 2010-08-09
Posts: 405

Re: 3x+ battery life

of course this will go to wiki.
I posted here to ask for more suggestions.

I will add this to "laptop".


"After you do enough distro research, you will choose Arch."

Offline

#20 2012-01-23 19:47:26

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: 3x+ battery life

Might be worth to include the powersaving methods from those sources too.

1. https://wiki.archlinux.org/index.php/Pm … wer_saving
2. https://bbs.archlinux.org/viewtopic.php?id=130785

Especially the latter seem to have some nice tweaks.

Regards

Offline

#21 2012-01-23 20:02:02

Earnestly
Member
Registered: 2011-08-18
Posts: 805

Re: 3x+ battery life

Additional information about what each option does and how it can effect usage would also be welcome.

(e.g. NMI Watchdog)
(e.g.

#Enabling the controller can produce "clicking" noises when the device wakes up
echo Y > /sys/module/snd_hda_intel/parameters/power_save_controller

)

Edit: I believe most of this has been covered already but here's some nice ideas from Red Hat

Last edited by Earnestly (2012-01-23 21:17:22)

Offline

#22 2012-01-23 21:14:15

broken pipe
Member
Registered: 2010-12-10
Posts: 216

Re: 3x+ battery life

one module might be recommendable to blacklist: uhci_hcd
it's only used for usb 1.1 devices and needs 1-2 watt

for taking down bluetooth:
hciconfig hci0 down ; rmmod hci_usb

Those modules are often a reason for interrupts and wakeups. But they also disable hardware, so use them with caution tongue
blacklist pcmcia
blacklist yenta_socket
blacklist ehci_hcd
blacklist uhci_hcd 
blacklist usbcore
blacklist ohci1394
blacklist firewire-ohci

remount using relatime (thx army):
mount -o remount,relatime /

powersaving for ati video cards:
https://wiki.archlinux.org/index.php/Ati#Powersaving

Offline

#23 2012-01-23 22:34:30

venky80
Member
Registered: 2007-05-13
Posts: 996

Re: 3x+ battery life

is this script relevant for SSDs? Also would it work for ATI graphics card?

Last edited by venky80 (2012-01-23 22:35:03)


DELL XPS 1640 with ATI Mobility Radeon  HD 3670. Arch Linux KDE Minimal Install

Offline

#24 2012-01-24 05:51:34

jocheem67
Member
Registered: 2009-11-09
Posts: 208

Re: 3x+ battery life

pcie_aspm=force i915.semaphores=1 i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1"

Intel chipsets/graphics could really benefit from these settings, check out phoronix..

echo powersave > /sys/module/pcie_aspm/parameters/policy

I feel that it' s necessary to use this kernelsetting towards aspm. Otherwise there's no use in passing the grub parameter..anyone confirms this?

is this script relevant for SSDs? Also would it work for ATI graphics card?

Noatime and discard are the fstab options you could use..and proper allignment..there's an arch wiki 'bout ssd's..

Last edited by jocheem67 (2012-01-24 05:53:55)

Offline

#25 2012-01-24 06:49:08

moetunes
Member
From: A comfortable couch
Registered: 2010-10-09
Posts: 1,024

Re: 3x+ battery life

I have as my kernel line

kernel /vmlinuz-linux root=/dev/sda3 ro acpi_osi= i915.modeset=1 pcie_aspm=force i915.i915_enable_rc6=1

That alone gives me about a half hour extra battery time, if I don't watch any vids or flash, if I do the battery time seems to be about a half hour less then without those kernel options.


You're just jealous because the voices only talk to me.

Offline

Board footer

Powered by FluxBB