Shuffled pages back up a level; Added links to main page that someone else had.
[ikiwiki.git] / docs / user / Powersave.mdwn
CommitLineData
c7efb544 1# Powersaving with DragonFly laptop
8b2a55bf 2
c7efb544 3[[!toc levels=2]]
8b2a55bf 4
5Here are some hints to make DragonFly laptop suck less power and therefore run longer and cooler.
6
8b2a55bf 7At first general note - just blow dust out of your laptop. Due to nature of cooling used in laptops this might make huge difference in temperature. I've seen laptops where temperature dropped ~20°C after 5 seconds blowing session.
8
c7efb544 9## CPU C states
8b2a55bf 10
c7efb544 11Let CPU(s) switch to lower C-states than default C1. In DragonFly this can be controlled by *hw.acpi.cpu.cx_lowest* or *hw.cpu[NUM].cx_lowest* [sysctl(8)](http://leaf.dragonflybsd.org/cgi/web-man/?command#sysctl&section8). CPU(s) have to support lower states. With *hw.acpi.cpu.cx_lowest* you can control all CPUs (cores) at once, with *hw.cpu[NUM].cx_lowest* every CPU individually. *hw.cpu[NUM].cx_supported* gives to you the list of supported C-states and latencies of each supported state (how long it takes to switch from Cx to C0). *hw.cpu[NUM].cx_usage* gives to you some statistics.
8b2a55bf 12
c7efb544 13In my Lenovo Thinkpad X61s relevant sysctl's look like this:
8b2a55bf 14
15 $ sysctl hw.acpi.cpu.cx_lowest
16 hw.acpi.cpu.cx_lowest: C3
17
18 $ sysctl -a | grep ^hw.cpu
19 hw.cpu0.cx_supported: C1/1 C2/1 C3/17
20 hw.cpu0.cx_lowest: C3
21 hw.cpu0.cx_usage: 0.00% 0.80% 99.19%
22 hw.cpu1.cx_supported: C1/1 C2/1 C3/17
23 hw.cpu1.cx_lowest: C3
24 hw.cpu1.cx_usage: 0.00% 0.48% 99.51%
25
c7efb544 26On my idle laptop switching lowest to C3 from C1 makes ~2.5W difference in power consumption and 10°C difference in temperature.
8b2a55bf 27
c7efb544 28ACPI supports only states up to C3, but modern mobile CPU's support C-states up to C6. CPU's can be forced to enter these lower states, but it's not really recommended. If you really want to experiment with this, you have to consult the manual of chipset you are using.
8b2a55bf 29
c7efb544 30My brief experience shows that there is no difference in power consumption whether you are using C4 or lowering a voltage with [est(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#est&section4). C5 and C6 can make sense in tickless system only (DragonFly isn't such).
8b2a55bf 31
859653ef 32You can find more general info about processor C-states [here](http://www.techarp.com/showarticle.aspx?artno=420&pgno=5).
8b2a55bf 33
c7efb544 34## EST
8b2a55bf 35
c7efb544 36Use [est(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#est&section4) if possible. The one currently in the DragonFly kernel doesn't support modern multicore CPU's. I'm using the one written by Michal Belczyk you can get from [here](http://bsd.krakow.pl/df/est_core.tgz).
8b2a55bf 37
c7efb544 38In my Lenovo Thinkpad X61s relevant sysctl's look like this:
8b2a55bf 39
40 $ sysctl machdep.est
41 machdep.est.frequency.available: 1200 1400 1600
42 machdep.est.frequency.current: 1200
43 machdep.est.frequency.target: 1200
44 machdep.est.voltage.available: 940 956 972 988 1004 1020 1036 1052 1068 1084 1100 1116
45 machdep.est.voltage.current: 940
46 machdep.est.voltage.target: 940
47
c7efb544 48Switching to minimums (frequency really doesn't matter in idle machine though) makes ~1.7W difference in power consumption in my idle laptop.
8b2a55bf 49
c7efb544 50## Backlight
8b2a55bf 51
52Switch backlight to (usable) minimum. There might be several ways to do it, you have to find the one which works for you.
53
54Things you can look at:
55
56* [acpi_video(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#acpi_video&section4) - ACPI Video Extensions. Should work on every modern laptop, but the interface is ... messy ...
57* [acpi_thinkpad(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#acpi_thinkpad&section4) - the ACPI driver for various features in IBM/Lenovo Thinkpad laptops. The brightness control doesn't work well with newest laptops, fixing this is in my TODO.
58* [acpi_toshiba(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#acpi_toshiba&section4) - the ACPI driver for HCI (Hardware Control Interface) used by Toshiba laptops. Haven't tested this as I don't own any.
59* [xbacklight(1)](http://pkgsrc.se/x11/xbacklight) - userspace application to adjust backlight brightness using RandR extension. Should work with all Intel graphics chips and newer ATI/AMD ones.
60
61Switching backlight brightness from 100% to 20% (still completely usable) with acpi_video(4) makes ~2.6W difference in power consumption in my X61s.
62
c7efb544 63## Network interfaces down
8b2a55bf 64
c7efb544 65Put network interfaces not in use to down (ifconfig if[NUM] down). This can make huge difference in both power consumption and temperature especially with wireless devices.
8b2a55bf 66
c7efb544 67It makes ~2.5W difference in power consumption and 10°C difference (according to [acpi_thinkpad(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#acpi_thinkpad&section4) sensors) in my X61s with [ath(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command=ath&section=4) card.
8b2a55bf 68
c7efb544
H
69## Unused devices
70
71DragonFly lets you put devices not in use (no driver attached to it) to the D3 (power off) state. By default no device is put into D3, but you can control it with hw.pci.do_power_nodriver tunable (set it to 3 if you don't have good reason not to do it). You can switch devices into D3 at runtime via unloading module (ie. making a device "not in use"). Please note that unloading/loading modules is not well tested and it's common that unloading module (or loading it after unloading) makes device unusable or even panics a system.
72
73Savings highly depend on hardware. There are some numbers from my X61s:
8b2a55bf 74
75* [em(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#em&section4) - no difference
76* [ath(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#ath&section4) - ~0.2W
77* [snd_hda(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#snd_hda&section4) - ~0.3W
78
859653ef 79[Here](http://www.techarp.com/showarticle.aspx?artno=420&pgno=4) you can find more general info about devices' D-states.
8b2a55bf 80
c7efb544 81*More to come ...*