X-Git-Url: https://gitweb.dragonflybsd.org/ikiwiki.git/blobdiff_plain/f728e869d1dcc58d46485afff3f6fc7f1a4e49fe..HEAD:/docs/user/Powersave.mdwn diff --git a/docs/user/Powersave.mdwn b/docs/user/Powersave.mdwn index 6b8f5d01..d81112a3 100644 --- a/docs/user/Powersave.mdwn +++ b/docs/user/Powersave.mdwn @@ -10,42 +10,62 @@ At first general note - just blow dust out of your laptop. Due to nature of cool Let 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§ion8). 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. -In my Lenovo Thinkpad X61s relevant sysctl's look like this: +You will generally want to control all the CPUs at once: - $ sysctl hw.acpi.cpu.cx_lowest - hw.acpi.cpu.cx_lowest: C3 - - $ sysctl -a | grep ^hw.cpu - hw.cpu0.cx_supported: C1/1 C2/1 C3/17 - hw.cpu0.cx_lowest: C3 - hw.cpu0.cx_usage: 0.00% 0.80% 99.19% - hw.cpu1.cx_supported: C1/1 C2/1 C3/17 - hw.cpu1.cx_lowest: C3 - hw.cpu1.cx_usage: 0.00% 0.48% 99.51% + # sysctl hw.acpi.cpu.cx_lowest=C3 -On my idle laptop switching lowest to C3 from C1 makes ~2.5W difference in power consumption and 10°C difference in temperature. +Additionaly, this enables deep C-states: -ACPI 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. + # sysctl machdep.mwait.CX.idle=AUTODEEP -My 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§ion4). C5 and C6 can make sense in tickless system only (DragonFly isn't such). +(Note that you can add the sysctl commands to */etc/sysctl.conf* so they are called automatically at boot-time.) -You can find more general info about processor C-states [here](http://www.techarp.com/showarticle.aspx?artno=420&pgno=5). +Relevant sysctl's then look like this: + + $ sysctl hw.acpi | grep cx + hw.acpi.cpu.cx_lowest: C3 + hw.acpi.cpu.cx_lowest_use: C3 + hw.acpi.cpu0.cx_supported: C1/1 C2/1 C3/57 + hw.acpi.cpu0.cx_lowest: C3 + hw.acpi.cpu0.cx_lowest_use: C3 + hw.acpi.cpu0.cx_usage: 3.54% 57.09% 39.36% last 9us + hw.acpi.cpu1.cx_supported: C1/1 C2/1 C3/57 + hw.acpi.cpu1.cx_lowest: C3 + hw.acpi.cpu1.cx_lowest_use: C3 + hw.acpi.cpu1.cx_usage: 0.00% 9.09% 90.90% last 804us + +You may need to add these lines to */boot/loader.conf* (for example if you get a "No such file or directory" error and a "no suitable intr cputimer found" message in dmesg when calling sysctl with the above parameters): -## EST + # Use i8254 as interrupt cputimer + hw.i8254.intr_disable="0" + # Get proper deep C-states + machdep.cpu.mwait.bm_sts="0" -Use [est(4)](http://leaf.dragonflybsd.org/cgi/web-man/?command#est§ion4) 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). +On my idle laptop (Lenovo Thinkpad X61s) switching lowest to C3 from C1 makes ~2.5W difference in power consumption and 10°C difference in temperature. -In my Lenovo Thinkpad X61s relevant sysctl's look like this: +ACPI 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. +Note that C5 and C6 can make sense in tickless system only (DragonFly isn't such). - $ sysctl machdep.est - machdep.est.frequency.available: 1200 1400 1600 - machdep.est.frequency.current: 1200 - machdep.est.frequency.target: 1200 - machdep.est.voltage.available: 940 956 972 988 1004 1020 1036 1052 1068 1084 1100 1116 - machdep.est.voltage.current: 940 - machdep.est.voltage.target: 940 +You can find more general info about processor C-states [here](http://www.techarp.com/showarticle.aspx?artno=420&pgno=5). -Switching to minimums (frequency really doesn't matter in idle machine though) makes ~1.7W difference in power consumption in my idle laptop. +## Frequency scaling + +Use [powerd(8)](http://leaf.dragonflybsd.org/cgi/web-man/?command=powerd§ion=8) for frequency scaling by adding `powerd_enable="YES"` to */etc/rc.conf*. You can then observe the frequency values in sysctl (example from the leaf.dragonflybsd.org machine): + + $ sysctl hw.acpi.cpu | grep px + hw.acpi.cpu.px_dom3.available: 2600 1300 + hw.acpi.cpu.px_dom3.members: cpu3(2600) + hw.acpi.cpu.px_dom3.select: 2600 + hw.acpi.cpu.px_dom2.available: 2600 1300 + hw.acpi.cpu.px_dom2.members: cpu2(2600) + hw.acpi.cpu.px_dom2.select: 2600 + hw.acpi.cpu.px_dom1.available: 2600 1300 + hw.acpi.cpu.px_dom1.members: cpu1(2600) + hw.acpi.cpu.px_dom1.select: 2600 + hw.acpi.cpu.px_dom0.available: 2600 1300 + hw.acpi.cpu.px_dom0.members: cpu0(2600) + hw.acpi.cpu.px_dom0.select: 2600 + hw.acpi.cpu.px_global: 2600 ## Backlight @@ -78,4 +98,20 @@ Savings highly depend on hardware. There are some numbers from my X61s: [Here](http://www.techarp.com/showarticle.aspx?artno=420&pgno=4) you can find more general info about devices' D-states. -*More to come ...* +## AHCI + +Some AHCI host bus adapters have link power management support. +This feature can be controlled with a per-port sysctl, for example to activate agressive power management on ports 0 and 1: + + # sysctl hw.ahci0.0.link_pwr_mgmt=2 + # sysctl hw.ahci0.1.link_pwr_mgmt=2 + +Enabling AHCI link power management can save ~0.8W. + +## Other resources + +If you are using a compatible Intel CPU, the corepower(4) kernel module can, once loaded, report power usage through either of these two commands + + sysctl hw.sensors + + systat -sensors