/[gentoo]/xml/htdocs/doc/en/power-management-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/power-management-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 Revision 1.8
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 2<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.7 2004/10/11 00:51:36 vapier Exp $ --> 3<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v 1.8 2005/01/17 10:10:23 swift Exp $ -->
4<guide link="power-management-guide.xml"> 4<guide link="power-management-guide.xml">
5<title>Power Management Guide</title> 5<title>Power Management Guide</title>
6 6
7<author title="Author"> 7<author title="Author">
8 <mail link="fragfred@gmx.de">Dennis Nienh&#252;ser</mail> 8 <mail link="fragfred@gmx.de">Dennis Nienh├╝ser</mail>
9</author> 9</author>
10 10
11<abstract> 11<abstract>
12Power Management is the key to extend battery run time on mobile systems like 12Power Management is the key to extend battery run time on mobile systems like
13laptops. This guide assists you setting it up on your laptop. 13laptops. This guide assists you setting it up on your laptop.
15 15
16<!-- The content of this document is licensed under the CC-BY-SA license --> 16<!-- The content of this document is licensed under the CC-BY-SA license -->
17<!-- See http://creativecommons.org/licenses/by-sa/2.0 --> 17<!-- See http://creativecommons.org/licenses/by-sa/2.0 -->
18<license/> 18<license/>
19 19
20<version>1.17</version> 20<version>1.18</version>
21<date>October 10, 2004</date> 21<date>January 05, 2005</date>
22 22
23<chapter> 23<chapter>
24<title>Introduction</title> 24<title>Introduction</title>
25 25
26<section> 26<section>
162 CPU Frequency Scaling ---&gt; 162 CPU Frequency Scaling ---&gt;
163 [*] CPU Frequency scaling 163 [*] CPU Frequency scaling
164 Default CPUFreq governor (userspace) 164 Default CPUFreq governor (userspace)
165 &lt;*&gt; 'performance' governor 165 &lt;*&gt; 'performance' governor
166 &lt;*&gt; 'powersave' governor 166 &lt;*&gt; 'powersave' governor
167 &lt;*&gt; 'ondemand' cpufreq policy governor
167 &lt;*&gt; CPU frequency table helpers 168 &lt;*&gt; CPU frequency table helpers
168 &lt;M&gt; ACPI Processor P-States driver 169 &lt;M&gt; ACPI Processor P-States driver
169 &lt;*&gt; <i>CPUFreq driver for your processor</i> 170 &lt;*&gt; <i>CPUFreq driver for your processor</i>
170</pre> 171</pre>
171 172
172<p> 173<p>
173Decide yourself whether you want to enable Software Suspend, Suspend-to-Disk 174Decide yourself whether you want to enable Software Suspend, Suspend-to-Disk and
174and Sleep States (see below). If you own an ASUS, Medion or Toshiba laptop, 175Sleep States (see below). If you own an ASUS, Medion or Toshiba laptop, enable
175enable the appropriate section. 176the appropriate section. Recent kernel versions (2.6.9 and later) include an
177<e>'ondemand' governor</e> for CPU Frequency Scaling, activate it as well when
178using such a kernel.
179</p>
180
181<p>
182The kernel has to know how to enable CPU frequency scaling on your processor. As
183each type of CPU has a different interface, you've got to choose the right
184driver for your processor. Be careful here - enabling <e>Intel Pentium 4 clock
185modulation</e> on a Pentium M system will lead to strange results for example.
186Consult the kernel documentation if you're unsure which one to take.
176</p> 187</p>
177 188
178<p> 189<p>
179Compile your kernel, make sure the right modules get loaded at startup and boot 190Compile your kernel, make sure the right modules get loaded at startup and boot
180into your new ACPI-enabled kernel. Next run <c>emerge sys-apps/acpid</c> to get 191into your new ACPI-enabled kernel. Next run <c>emerge sys-apps/acpid</c> to get
228<title>Reacting on ACPI events</title> 239<title>Reacting on ACPI events</title>
229<body> 240<body>
230 241
231<p> 242<p>
232Typical ACPI events are closing the lid, changing the power source or pressing 243Typical ACPI events are closing the lid, changing the power source or pressing
233the sleep button. Every acpi event recognized by the kernel is catched by acpid 244the sleep button. An important event is changing the power source, which should
234which calls <path>/etc/acpi/default.sh</path>. Here is a basic modification 245cause a runlevel switch. Create the following files to switch between
235supporting runlevel switching: 246<e>default</e> and <e>battery</e> runlevel depending on the power source:
236</p> 247</p>
237 248
238<pre caption="Event driven runlevel switching with acpid"> 249<pre caption="/etc/acpi/switch_runlevel.sh">
239#!/bin/sh 250#!/bin/bash
240 251
241set $*
242
243group=${1/\/*/}
244action=${1/*\//}
245
246<comment># runlevel to use in AC mode</comment>
247RLVL_AC="default" 252RUNLEVEL_AC="default"
248<comment># runlevel to use in battery mode</comment>
249RLVL_BATTERY="battery" 253RUNLEVEL_BATTERY="battery"
250 254
251<comment># file indicating the AC state. Verify the filename before using</comment> 255function on_ac () {
252AC_STATE="/proc/acpi/ac_adapter/AC/state" 256 if which on_ac_power &amp;> /dev/null
253<comment># this string means running on AC</comment> 257 then
254AC_ON="on-line" 258 on_ac_power
255<comment># this string means running on batteries</comment> 259 else
256AC_OFF="off-line" 260 grep --quiet on-line /proc/acpi/ac_adapter/*/state
261 fi
262}
257 263
258function SwitchRunlevel() { 264function SwitchRunlevel () {
259 if [[ "$(grep ${AC_OFF} ${AC_STATE})" != "" &amp;&amp; "$(cat /var/lib/init.d/softlevel)" != "${RLVL_BATTERY}" ]] 265
266 if [ ! -d "/etc/runlevels/${RUNLEVEL_AC}" ]
267 then
268 logger "${0}: Runlevel ${RUNLEVEL_AC} does not exist. Aborting."
269 exit 1
270 fi
271
272
273 if [ ! -d "/etc/runlevels/${RUNLEVEL_BATTERY}" ]
274 then
275 logger "${0}: Runlevel ${RUNLEVEL_BATTERY} does not exist. Aborting."
276 exit 1
277 fi
278
279 if on_ac
280 then if [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_AC}" ]]
260 then 281 then
261 logger "Switching to ${RLVL_BATTERY} runlevel" 282 logger "Switching to ${RUNLEVEL_AC} runlevel"
262 /sbin/rc ${RLVL_BATTERY} 283 /sbin/rc ${RUNLEVEL_AC}
263 elif [[ "$(grep ${AC_ON} ${AC_STATE})" != "" &amp;&amp; "$(cat /var/lib/init.d/softlevel)" != "${RLVL_AC}" ]] 284 fi
285 elif [[ "$(cat /var/lib/init.d/softlevel)" != "${RUNLEVEL_BATTERY}" ]]
264 then 286 then
265 logger "Switching to ${RLVL_AC} runlevel" 287 logger "Switching to ${RUNLEVEL_BATTERY} runlevel"
266 /sbin/rc ${RLVL_AC} 288 /sbin/rc ${RUNLEVEL_BATTERY}
267 fi 289 fi
268} 290}
291</pre>
269 292
293<pre caption="/etc/acpi/events/pmg_ac_adapter">
294event=ac_adapter.*
295action=/etc/acpi/actions/pmg_ac_adapter.sh %e
296</pre>
270 297
271case "$group" in 298<pre caption="/etc/acpi/events/pmg_battery">
272 battery) 299event=battery.*
273 case "$action" in 300action=/etc/acpi/actions/pmg_battery.sh %e
274 battery) 301</pre>
302
303<pre caption="/etc/acpi/actions/pmg_ac_adapter.sh">
304#!/bin/bash
305
306source /etc/acpi/switch_runlevel.sh
275 SwitchRunlevel 307SwitchRunlevel
276 ;; 308</pre>
277 *)
278 logger "ACPI group battery / action $action is not defined"
279 ;;
280 esac
281 ;;
282 309
283 ac_adapter) 310<pre caption="/etc/acpi/actions/pmg_battery.sh">
284 case "$action" in 311#!/bin/bash
285 ac_adapter) 312
313source /etc/acpi/switch_runlevel.sh
286 SwitchRunlevel 314SwitchRunlevel
287 ;; 315</pre>
288 *) 316
289 logger "ACPI group ac_adapter / action $action is not defined" 317<p>
290 ;; 318Some of these files must be executable. Last not least restart acpid to have
291 esac 319it recognize the changes.
292 ;; 320</p>
293 *) 321
294 logger "ACPI group $group / action $action is not defined" 322<pre caption="Finishing runlevel switching with acpid">
295 ;; 323<i># chmod +x /etc/acpi/switch_runlevel.sh</i>
296esac 324<i># chmod +x /etc/acpi/actions/pmg_*</i>
325<i># /etc/init.d/acpid restart</i>
297</pre> 326</pre>
298 327
299<p> 328<p>
300Give it a try: Plug AC in and out and watch syslog for the "Switching to AC 329Give it a try: Plug AC in and out and watch syslog for the "Switching to AC
301mode" or "Switching to battery mode" messages. 330mode" or "Switching to battery mode" messages. See the Troubleshooting
331section if the script is not able to detect the power source correctly.
302</p> 332</p>
303 333
304<p> 334<p>
305Due to the nature of the event mechanism, your laptop will boot into runlevel 335Due to the nature of the event mechanism, your laptop will boot into runlevel
306<e>default</e> regardless of the AC/battery state. You can add another entry 336<e>default</e> regardless of the AC/battery state. You can add another entry
307to the boot loader with <c>softlevel=boot</c>, but it's likely to forget 337to the boot loader with <c>softlevel=battery</c>, but it's likely to forget
308choosing it. A better way is faking an ACPI event in the end of the boot 338choosing it. A better way is faking an ACPI event in the end of the boot
309process and let the <path>/etc/acpi/default.sh</path> script decide whether a 339process and let the <path>/etc/acpi/default.sh</path> script decide whether a
310runlevel change is necessary. Open <path>/etc/conf.d/local.start</path> in your 340runlevel change is necessary. Open <path>/etc/conf.d/local.start</path> in your
311favourite editor and add these lines: 341favourite editor and add these lines:
312</p> 342</p>
313 343
314<pre caption="Runlevel switch at boot time by editing local.start"> 344<pre caption="Runlevel switch at boot time by editing local.start">
315<comment># Fake acpi event to switch runlevel if running on batteries</comment> 345<comment># Fake acpi event to switch runlevel if running on batteries</comment>
316/etc/acpi/default.sh "battery/battery" 346/etc/acpi/actions/pmg_battery.sh "battery/battery"
317</pre> 347</pre>
318 348
319<p> 349<p>
320Prepared like this you can activate Power Management policies for individual 350Prepared like this you can activate Power Management policies for individual
321devices. 351devices.
325</section> 355</section>
326</chapter> 356</chapter>
327 357
328<chapter> 358<chapter>
329<title>CPU Power Management</title> 359<title>CPU Power Management</title>
360<section>
361<title>Some technical terms</title>
362<body>
363
364<p>
365CPU frequency scaling brings up some technical terms that might be unknown to
366you. Here's a quick introduction.
367</p>
368
369<p>
370First of all, the kernel has to be able to change the processor's frequency. The
371<e>CPUfreq processor driver</e> knows the commands to do it on your CPU. Thus
372it's important to choose the right one in your kernel. You should already have
373done it above. Once the kernel knows how to change frequencies, it has to know
374which frequency it should set. This is done according to the <e>policy</e> which
375consists of <e>CPUfreq policy</e> and a <e>governor</e>. A CPUfreq policy are
376just two numbers which define a range the frequency has to stay between -
377minimal and maximal frequency. The governor now decides which of the available
378frequencies in between minimal and maximal frequency to choose. For example, the
379<e>powersave governor</e> always chooses the lowest frequency available, the
380<e>performance governor</e> the highest one. The <e>userspace governor</e> makes
381no decision but chooses whatever the user (or a program in userspace) wants -
382which means it reads the frequency from
383<path>/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed</path>.
384</p>
385
386<p>
387This doesn't sound like dynamic frequency changes yet and in fact it isn't.
388Dynamics however can be accomplished with various approaches. For example,
389the <e>ondemand governor</e> makes its decisions depending on the current CPU
390load. The same is done by various userland tools like <c>cpudyn</c>,
391<c>speedfreq</c>, <c>powernowd</c> and many more. ACPI events can be used to
392enable or disable dynamic frequency changes depending on power source.
393</p>
394
395</body>
396</section>
330<section> 397<section>
331<title>Setting the frequency manually</title> 398<title>Setting the frequency manually</title>
332<body> 399<body>
333 400
334<p> 401<p>
392<title>Automated frequency adaption</title> 459<title>Automated frequency adaption</title>
393<body> 460<body>
394 461
395<p> 462<p>
396The above is quite nice, but not doable in daily life. Better let your system 463The above is quite nice, but not doable in daily life. Better let your system
397set the appropriate frequency automatically. A couple of user space programs 464set the appropriate frequency automatically. There are many different approaches
398like to do it for you. The following table gives a quick overview to help you 465to do this. The following table gives a quick overview to help you decide on one
399decide on one of them. 466of them. It's roughly seperated in three categories <e>kernel</e> for approaches
467that only need kernel support, <e>daemon</e> for programs that run in the
468background and <e>graphical</e> for programs that provide a GUI for easy
469configuration and changes.
400</p> 470</p>
401 471
402<table> 472<table>
403<tr> 473<tr>
404 <th>Name</th> 474 <th>Name</th>
405 <th>Pro</th> 475 <th>Category</th>
476 <th>Switch decision</th>
477 <th>Kernel governors</th>
478 <th>Further governors</th>
406 <th>Con</th> 479 <th>Comments</th>
480</tr>
481<tr>
482 <ti>'ondemand' governor</ti>
483 <ti>Kernel</ti>
484 <ti>CPU load</ti>
485 <ti>N.A.</ti>
486 <ti>N.A.</ti>
487 <ti>
488 Further tuning through files in
489 <path>/sys/devices/system/cpu/cpu0/cpufreq/ondemand/</path>. Still requires
490 userland tools (programs, scripts) if governor switching or similar is
491 desired.
492 </ti>
407</tr> 493</tr>
408<tr> 494<tr>
409 <ti><uri link="http://mnm.uib.es/~gallir/cpudyn/">cpudyn</uri></ti> 495 <ti><uri link="http://mnm.uib.es/~gallir/cpudyn/">cpudyn</uri></ti>
410 <ti>Also supports disk standby</ti> 496 <ti>Daemon</ti>
497 <ti>CPU load</ti>
411 <ti></ti> 498 <ti>None</ti>
499 <ti>Dynamic</ti>
500 <ti>
501 Also supports disk standby - notice however that <e>laptop mode</e> in most
502 cases will do a better job.
503 </ti>
412</tr> 504</tr>
413<tr> 505<tr>
414 <ti><uri link="http://sourceforge.net/projects/cpufreqd/">cpufreq</uri></ti> 506 <ti><uri link="http://sourceforge.net/projects/cpufreqd/">cpufreqd</uri></ti>
415 <ti>Sophisticated setup possible</ti> 507 <ti>Daemon</ti>
416 <ti>Complicated setup</ti> 508 <ti>Battery state, CPU load, running programs</ti>
509 <ti>All available</ti>
510 <ti>None</ti>
511 <ti>
512 Sophisticated (but also complicated) setup. An optimal configuration
513 requires detailed knowledge of your system.
514 </ti>
515</tr>
516<tr>
517 <ti>
518 <uri link="http://www.deater.net/john/powernowd.html">powernowd</uri>
519 </ti>
520 <ti>Daemon</ti>
521 <ti>CPU load</ti>
522 <ti>None</ti>
523 <ti>Passive, sine, aggressive</ti>
524 <ti>
525 Supports SMP.
526 </ti>
417</tr> 527</tr>
418<tr> 528<tr>
419 <ti><uri link="http://www.goop.org/~jeremy/speedfreq/">speedfreq</uri></ti> 529 <ti><uri link="http://www.goop.org/~jeremy/speedfreq/">speedfreq</uri></ti>
530 <ti>Daemon</ti>
531 <ti>CPU load</ti>
532 <ti>None</ti>
533 <ti>Dynamic, powersave, performance, fixed speed</ti>
420 <ti> 534 <ti>
421 Small yet powerful<br /> 535 Small yet powerful with an useful client/server interface. Requires a 2.6
422 Useful client/server interface 536 kernel.
423 </ti> 537 </ti>
424 <ti>Kernel 2.6 series only</ti>
425</tr> 538</tr>
426<tr> 539<tr>
427 <ti><uri link="http://www.deater.net/john/powernowd.html">powernowd</uri></ti> 540 <ti><uri link="http://cpuspeedy.sourceforge.net/">gtk-cpuspeedy</uri></ti>
428 <ti>Supports SMP</ti> 541 <ti>Graphical</ti>
429 <ti></ti> 542 <ti>None</ti>
543 <ti>None</ti>
544 <ti>None</ti>
545 <ti>
546 Gnome application, a graphical tool to set CPU frequency manually. It does
547 not offer any automation and is mainly listed for the sake of completeness.
548 </ti>
549</tr>
550<tr>
551 <ti>klaptopdaemon</ti>
552 <ti>Graphical</ti>
553 <ti>Battery state</ti>
554 <ti>All available</ti>
555 <ti>None</ti>
556 <ti>
557 KDE only, 'ondemand' governor required for dynamic frequency scaling.
558 </ti>
430</tr> 559</tr>
431</table> 560</table>
432 561
433<p> 562<p>
434While adjusting the frequency to the current load looks simple on the first 563While adjusting the frequency to the current load looks simple on the first
456<pre caption="Starting speedfreq"> 585<pre caption="Starting speedfreq">
457# <i>/etc/init.d/speedfreq start</i> 586# <i>/etc/init.d/speedfreq start</i>
458</pre> 587</pre>
459 588
460<p> 589<p>
461Setting up cpufreq is a little bit more complicated. 590Setting up cpufreqd is a little bit more complicated.
462</p> 591</p>
463 592
464<warn> 593<warn>
465Do not run more than one of the above programs at the same time. It may cause 594Do not run more than one of the above programs at the same time. It may cause
466confusion like switching between two frequencies all the time. If you just 595confusion like switching between two frequencies all the time. If you just
467installed speedfreq, skip cpufreq now. 596installed speedfreq, skip cpufreqd now.
468</warn> 597</warn>
469 598
470<pre caption="Installing cpufreqd"> 599<pre caption="Installing cpufreqd">
471# <i>emerge cpufreqd</i> 600# <i>emerge cpufreqd</i>
472# <i>rc-update add cpufreqd battery</i> 601# <i>rc-update add cpufreqd battery</i>
546<p> 675<p>
547<c>cpudyn</c> and <c>powernowd</c> are installed in the same way as 676<c>cpudyn</c> and <c>powernowd</c> are installed in the same way as
548<c>speedfreq</c>. 677<c>speedfreq</c>.
549</p> 678</p>
550 679
680</body>
681</section>
682
683<section>
684<title>Verifying the result</title>
685
686<body>
687
551<p> 688<p>
552The last thing to check is that your new policies do a good job. An easy way to 689The last thing to check is that your new policies do a good job. An easy way to
553do so is monitoring the CPU speed while working with your laptop: 690do so is monitoring CPU speed while working with your laptop:
554</p> 691</p>
555 692
556<pre caption="Monitoring CPU speed"> 693<pre caption="Monitoring CPU speed">
557# <i>watch -n 1 grep "cpu MHz" /proc/cpuinfo</i> 694# <i>watch -n 1 grep "cpu MHz" /proc/cpuinfo</i>
558</pre> 695</pre>
690See <c>man hdparm</c> for the options. If your script is ready, add it to the 827See <c>man hdparm</c> for the options. If your script is ready, add it to the
691battery runlevel. 828battery runlevel.
692</p> 829</p>
693 830
694<pre caption="Automate disk standby settings"> 831<pre caption="Automate disk standby settings">
832# <i>chmod +x /etc/init.d/pm.hda</i>
695# <i>/sbin/depscan.sh</i> 833# <i>/sbin/depscan.sh</i>
696# <i>rc-update add pm.hda battery</i> 834# <i>rc-update add pm.hda battery</i>
697</pre> 835</pre>
698 836
699<impo> 837<impo>
713written to disk on read calls or after 10 minutes (instead of 30 seconds). This 851written to disk on read calls or after 10 minutes (instead of 30 seconds). This
714minimizes the time the hard disk needs to be spun up. 852minimizes the time the hard disk needs to be spun up.
715</p> 853</p>
716 854
717<p> 855<p>
718<!-- FIXME: bug #45593 --> 856<!-- TODO: bug #45593 -->
719To start and stop laptop-mode, create a script /etc/init.d/laptop-mode. You can 857Besides kernel support you also need a script that controls starting and
720take the one included in 858stopping of laptop-mode. You kernel documentation in
721<path>/usr/src/linux/Documentation/laptop-mode.txt</path>. Onces it's ready, 859<path>/usr/src/linux/Documentation/laptop-mode.txt</path> contains one as well
722make sure it gets called. 860as the package <c>laptop-mode-tools</c>. None of them is easy to install
861though.
862</p>
863
723</p> 864<p>
724 865Ebuilds for laptop-mode-tools are not in Portage, because Gentoo developers
725<pre caption="Automatic start of laptop-mode"> 866don't think they are production ready yet. Take that into consideration
726# <i>rc-update add laptop-mode battery</i> 867before using the ebuilds which can be found in <uri
868link="http://bugs.gentoo.org/show_bug.cgi?id=45593">Bugzilla</uri>. The Gentoo
869Handbook tells you how to use external ebuilds if you don't know where to put
870them. Once your PORTDIR_OVERLAY contains the ebuilds, install the
871script:
727</pre> 872</p>
728 873
729<warn> 874<warn>
730Once again: Be careful with sleep/spin down settings of your hard drive. 875This package is not seen as production ready and installing custom ebuilds from
731Setting it to small values might wear out your drive and lose warranty. Be sure 876Bugzilla is not recommended. Please don't use laptop-mode-tools if you're
732to read the documentation in laptop-mode.txt. Make sure to stop laptop-mode 877unsure.
733before your battery runs out of power and data gets written to disk - otherwise
734you will at least lose the last 10 minutes of your work.
735</warn> 878</warn>
879
880<pre caption="Automated start of laptop-mode">
881# <i>emerge laptop-mode-tools</i>
882</pre>
883
884<p>
885<c>laptop-mode-tools</c> has it's configuration file in
886<path>/etc/laptop-mode/laptop-mode.conf</path>. Adjust it the way you like it,
887it's well commented. If you have <e>apm</e> or <e>acpi</e> in your USE flags,
888laptop-mode will be started automatically in battery mode. Otherwise you can
889automate it by running <c>rc-update add laptop-mode battery</c>.
890</p>
736 891
737</body> 892</body>
738</section> 893</section>
739<section> 894<section>
740<title>Other tricks</title> 895<title>Other tricks</title>
820Save it as <path>/etc/init.d/pm.wlan0</path> and add it to the battery runlevel 975Save it as <path>/etc/init.d/pm.wlan0</path> and add it to the battery runlevel
821like the disk script above. See <c>man iwconfig</c> for details and more 976like the disk script above. See <c>man iwconfig</c> for details and more
822options. If your driver and access point support changing the beacon time, this 977options. If your driver and access point support changing the beacon time, this
823is a good starting point to save even more energy. 978is a good starting point to save even more energy.
824</p> 979</p>
980
981<pre caption="Power Management for WLAN">
982# <i>chmod +x /etc/init.d/pm.wlan0</i>
983# <i>/sbin/depscan.sh</i>
984# <i>rc-update add pm.wlan0 battery</i>
985</pre>
825 986
826</body> 987</body>
827</section> 988</section>
828<section> 989<section>
829<title>USB Power Management</title> 990<title>USB Power Management</title>
946<comment>(kernel 2.4 series)</comment> 1107<comment>(kernel 2.4 series)</comment>
947# <i>echo 1 &gt; /proc/acpi/sleep</i> <comment>(standby)</comment> 1108# <i>echo 1 &gt; /proc/acpi/sleep</i> <comment>(standby)</comment>
948# <i>echo 3 &gt; /proc/acpi/sleep</i> <comment>(sleep)</comment> 1109# <i>echo 3 &gt; /proc/acpi/sleep</i> <comment>(sleep)</comment>
949 1110
950<comment>(kernel 2.6 series)</comment> 1111<comment>(kernel 2.6 series)</comment>
951# <i>echo -n standby &gt; /sys/power/state</i> <comment>standby</comment> 1112# <i>echo -n standby &gt; /sys/power/state</i> <comment>(standby)</comment>
952# <i>echo -n mem &gt; /sys/power/state</i> <comment>sleep</comment> 1113# <i>echo -n mem &gt; /sys/power/state</i> <comment>(sleep)</comment>
953 1114
954<comment>(swsusp)</comment> 1115<comment>(swsusp)</comment>
955# <i>echo 4 &gt; /proc/acpi/sleep</i> <comment>hibernate</comment> 1116# <i>echo 4 &gt; /proc/acpi/sleep</i> <comment>(hibernate)</comment>
956 1117
957<comment>(Suspend-to-Disk)</comment> 1118<comment>(Suspend-to-Disk)</comment>
958# <i>echo -n disk &gt; /sys/power/state</i> <comment>hibernate</comment> 1119# <i>echo -n disk &gt; /sys/power/state</i> <comment>(hibernate)</comment>
959 1120
960<comment>(swsusp2)</comment> 1121<comment>(swsusp2)</comment>
961# <i>echo &gt; /proc/swsusp/activate</i> 1122# <i>/usr/sbin/hibernate</i> <comment>(hibernate, see below)</comment>
962</pre> 1123</pre>
963 1124
964<warn> 1125<warn>
965Backup your data before doing this. Run <c>sync</c> before executing one of the 1126Backup your data before doing this. Run <c>sync</c> before executing one of the
966commands to have cached data written to disk. First try it outside of X, then 1127commands to have cached data written to disk. First try it outside of X, then
974</p> 1135</p>
975 1136
976<p> 1137<p>
977While the above should be sufficient to get swsusp and Suspend-to-Disk running 1138While the above should be sufficient to get swsusp and Suspend-to-Disk running
978(I didn't say working), swsusp2 needs special care. 1139(I didn't say working), swsusp2 needs special care.
979The first thing to do is to patch the kernel with the patches provided at <uri 1140The first thing to do is patching the kernel with the patches provided at <uri
980link="http://softwaresuspend.berlios.de/"> 1141link="http://softwaresuspend.berlios.de/">
981http://softwaresuspend.berlios.de/</uri>. Afterwards, install the hibernate 1142http://softwaresuspend.berlios.de/</uri>. Additionally you've got to emerge
982script from the same page. 1143<c>hibernate-script</c>. Once it is installed, configure
1144<path>/etc/hibernate/hibernate.conf</path> and try whether it works:
1145</p>
1146
1147<pre>
1148<i># emerge hibernate-script</i>
1149<i># $EDITOR /etc/hibernate/hibernate.conf</i>
1150<comment>(Last chance to backup any data)</comment>
1151<i># hibernate</i>
983</p> 1152</pre>
984 1153
985</body> 1154</body>
986</section> 1155</section>
987</chapter> 1156</chapter>
988 1157
1027<e>Q:</e> My laptop supports frequency scaling, but according to /proc/cpuinfo 1196<e>Q:</e> My laptop supports frequency scaling, but according to /proc/cpuinfo
1028the speed never changes. 1197the speed never changes.
1029</p> 1198</p>
1030 1199
1031<p> 1200<p>
1032<e>A:</e> This seems to be a kernel bug. Run <c>emerge x86info</c>, update your 1201<e>A:</e> Probably you have activated symmetric multiprocessing support
1202(CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older
1203kernels had a bug causing this. In that case, run <c>emerge x86info</c>,
1033kernel as asked and check the current frequency with <c>x86info -mhz</c>. 1204update your kernel as asked and check the current frequency with
1205<c>x86info -mhz</c>.
1034</p> 1206</p>
1035 1207
1036<p> 1208<p>
1037<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in 1209<e>Q:</e> I can change the CPU frequency, but the range is not as wide as in
1038another OS. 1210another OS.
1047/proc/acpi/processor/CPU/limit</c>, where x is one of the Tx states listed in 1219/proc/acpi/processor/CPU/limit</c>, where x is one of the Tx states listed in
1048<path>/proc/acpi/processor/CPU/throttling</path>. 1220<path>/proc/acpi/processor/CPU/throttling</path>.
1049</p> 1221</p>
1050 1222
1051<p> 1223<p>
1224<e>Q:</e> When configuring the kernel, powersave, performance and userspace
1225governors show up, but that ondemand thing is missing. Where do I get it?
1226</p>
1227
1228<p>
1229<e>A:</e> The ondemand governor is only included in recent kernel sources. Try
1230updating them.
1231</p>
1232
1233<p>
1234<e>Q:</e> Runlevel switching doesn't work - the script is not able to determine
1235the power source correctly.
1236</p>
1237
1238<p>
1239<e>A:</e> On some systems, the power source can't be determined by reading
1240<path>/proc/acpi/ac_adapter/*/state</path>. If it fails for you, create a
1241custom script <c>on_ac_power</c> or use the one from <c>powermgmt-base</c>.
1242An ebuild can be found in <uri
1243link="http://bugs.gentoo.org/show_bug.cgi?id=76516">Bug #76516</uri>. You
1244only have to emerge it, it works transparently with the above script.
1245</p>
1246
1247<p>
1052<e>Q:</e> Battery life time seems to be worse than before. 1248<e>Q:</e> Battery life time seems to be worse than before.
1053</p> 1249</p>
1054 1250
1055<p> 1251<p>
1056<e>A:</e> Check your BIOS settings. Maybe you forgot to re-enable some of the 1252<e>A:</e> Check your BIOS settings. Maybe you forgot to re-enable some of the
1103<p> 1299<p>
1104If the "last full capacity" differs significantly from the design capacity, 1300If the "last full capacity" differs significantly from the design capacity,
1105your battery is probably broken. Try to claim your warranty. 1301your battery is probably broken. Try to claim your warranty.
1106</p> 1302</p>
1107 1303
1304<p>
1305<e>Q:</e> My problem is not listed above. Where should I go next?
1306</p>
1307
1308<p>
1309<e>A:</e> Don't fear to contact me, <mail link="fragfred@gmx.de">Dennis
1310Nienh├╝ser</mail>, directly.
1311</p>
1312
1108</body> 1313</body>
1109</section> 1314</section>
1110</chapter> 1315</chapter>
1111</guide> 1316</guide>

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20