From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1G619G-0001wk-JD for garchives@archives.gentoo.org; Thu, 27 Jul 2006 08:23:15 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.7/8.13.6) with SMTP id k6R8N4eU008946; Thu, 27 Jul 2006 08:23:04 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.13.7/8.13.6) with ESMTP id k6R8N2Gq025355 for ; Thu, 27 Jul 2006 08:23:03 GMT Received: from lark (lark.gentoo.osuosl.org [140.211.166.177]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with SMTP id C37B56466A for ; Thu, 27 Jul 2006 08:23:01 +0000 (UTC) Received: by lark (sSMTP sendmail emulation); Thu, 27 Jul 2006 08:23:01 +0000 From: "Lukasz Damentko" Date: Thu, 27 Jul 2006 08:23:01 +0000 To: gentoo-doc-cvs@lists.gentoo.org Subject: [gentoo-doc-cvs] cvs commit: power-management-guide.xml Message-Id: <20060727082301.C37B56466A@smtp.gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-doc-cvs@gentoo.org Reply-to: docs-team@lists.gentoo.org X-Archives-Salt: b991ab88-5047-421a-b1f1-6f6265405ca0 X-Archives-Hash: 281bd6124df99371914b9c06903ed9a2 rane 06/07/27 08:23:01 Modified: power-management-guide.xml Log: fixed line wrapping, *no content change* Revision Changes Path 1.20 xml/htdocs/doc/en/power-management-guide.xml file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/power-management-guide.xml?rev=1.20&view=markup plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/power-management-guide.xml?rev=1.20&content-type=text/plain diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/doc/en/power-management-guide.xml?r1=1.19&r2=1.20 Index: power-management-guide.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/power-management-guide.xml,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- power-management-guide.xml 27 Jul 2006 08:13:32 -0000 1.19 +++ power-management-guide.xml 27 Jul 2006 08:23:01 -0000 1.20 @@ -1,6 +1,6 @@ - + Power Management Guide @@ -66,11 +66,11 @@ whithout losing too much performance. A few different tricks prevent your hard drive from working unnecessarily often in Disk Power Management (decreasing noise level as a nice side effect). Some notes on -graphics cards, Wireless LAN and USB finish the device section in -Power Management For Other Devices while another +graphics cards, Wireless LAN and USB finish the device section in Power Management For Other Devices while another chapter is dedicated to the (rather experimental) sleep -states. Last not least Troubleshooting -lists common pitfalls. +states. Last not least Troubleshooting lists +common pitfalls.

@@ -101,12 +101,11 @@

Before discussing the details of making individual devices Power Management -aware, make sure certain requirements are met. After controlling BIOS -settings, some kernel options want to be enabled - these are in short ACPI, -sleep states and CPU frequency scaling. As power saving most of the time comes -along with performance loss or increased latency, it should only be enabled -when running on batteries. That's where a new runlevel battery comes in -handy. +aware, make sure certain requirements are met. After controlling BIOS settings, +some kernel options want to be enabled - these are in short ACPI, sleep states +and CPU frequency scaling. As power saving most of the time comes along with +performance loss or increased latency, it should only be enabled when running +on batteries. That's where a new runlevel battery comes in handy.

@@ -151,7 +150,7 @@

-There are different kernel sources in Portage. I'd recommend using +There are different kernel sources in Portage. I'd recommend using gentoo-sources or suspend2-sources. The latter contains patches for Software Suspend 2, see the chapter about sleep states for more details. When configuring the kernel, activate at least @@ -182,7 +181,7 @@ [ ] Debug Statements [*] Power Management Timer Support < > ACPI0004,PNP0A05 and PNP0A06 Container Driver (EXPERIMENTAL) - + CPU Frequency Scaling ---> [*] CPU Frequency scaling [ ] Enable CPUfreq debugging @@ -205,8 +204,8 @@

-The kernel has to know how to enable CPU frequency scaling on your processor. As -each type of CPU has a different interface, you've got to choose the right +The kernel has to know how to enable CPU frequency scaling on your processor. +As each type of CPU has a different interface, you've got to choose the right driver for your processor. Be careful here - enabling Intel Pentium 4 clock modulation on a Pentium M system will lead to strange results for example. Consult the kernel documentation if you're unsure which one to take. @@ -214,12 +213,12 @@

Compile your kernel, make sure the right modules get loaded at startup and boot -into your new ACPI-enabled kernel. Next run emerge sys-power/acpid to get -the acpi daemon. This one informs you about events like switching from AC to -battery or closing the lid. Make sure the modules are loaded if you didn't -compile them into the kernel and start acpid by executing -/etc/init.d/acpid start. Run rc-update add acpid default to load -it on startup. You'll soon see how to use it. +into your new ACPI-enabled kernel. Next run emerge sys-power/acpid to +get the acpi daemon. This one informs you about events like switching from AC +to battery or closing the lid. Make sure the modules are loaded if you didn't +compile them into the kernel and start acpid by executing /etc/init.d/acpid +start. Run rc-update add acpid default to load it on startup. You'll +soon see how to use it.

@@ -282,9 +281,9 @@
 

-You are now able to determine the power source by executing -on_ac_power && echo AC available || echo Running on batteries in -a shell. The script below is responsible for changing runlevels. Save it as +You are now able to determine the power source by executing on_ac_power +&& echo AC available || echo Running on batteries in a shell. The +script below is responsible for changing runlevels. Save it as /etc/acpi/actions/pmg_switch_runlevel.sh.

@@ -338,8 +337,8 @@

-Run the command above and pull the power cable. You should see something -like this: +Run the command above and pull the power cable. You should see something like +this:

@@ -378,21 +377,21 @@
 
 

Give it a try: Plug AC in and out and watch syslog for the "Switching to AC -mode" or "Switching to battery mode" messages. See the -Troubleshooting section if the script is not -able to detect the power source correctly. +mode" or "Switching to battery mode" messages. See the Troubleshooting section if the script is not able to +detect the power source correctly.

Due to the nature of the event mechanism, your laptop will boot into runlevel default regardless of the AC/battery state. This is fine when running -from AC, but we'd like to boot into the battery runlevel otherwise. One -solution would be to add another entry to the boot loader with the parameter +from AC, but we'd like to boot into the battery runlevel otherwise. One +solution would be to add another entry to the boot loader with the parameter softlevel=battery, but it's likely to forget choosing it. A better way -is faking an ACPI event in the end of the boot process and letting -pmg_switch_runlevel.sh script decide whether a -runlevel change is necessary. Open /etc/conf.d/local.start in your -favourite editor and add these lines: +is faking an ACPI event in the end of the boot process and letting +pmg_switch_runlevel.sh script decide whether a runlevel change is +necessary. Open /etc/conf.d/local.start in your favourite editor +and add these lines:

@@ -401,7 +400,7 @@
 

-Prepared like this you can activate Power Management policies for individual +Prepared like this you can activate Power Management policies for individual devices.

@@ -423,7 +422,6 @@ -
Some Technical Terms @@ -436,28 +434,27 @@

First of all, the kernel has to be able to change the processor's frequency. The CPUfreq processor driver knows the commands to do it on your CPU. -Thus it's important to choose the right one in your kernel. You should -already have done it above. Once the kernel knows how to change frequencies, -it has to know which frequency it should set. This is done according to the -policy which consists of a CPUfreq policy and a -governor. A CPUfreq policy are just two numbers which define a range -the frequency has to stay between - minimal and maximal frequency. The -governor now decides which of the available frequencies in between minimal -and maximal frequency to choose. For example, the powersave governor -always chooses the lowest frequency available, the performance -governor the highest one. The userspace governor makes no decision -but chooses whatever the user (or a program in userspace) wants - which means -it reads the frequency from +Thus it's important to choose the right one in your kernel. You should already +have done it above. Once the kernel knows how to change frequencies, it has to +know which frequency it should set. This is done according to the policy +which consists of a CPUfreq policy and a governor. A CPUfreq +policy are just two numbers which define a range the frequency has to stay +between - minimal and maximal frequency. The governor now decides which of the +available frequencies in between minimal and maximal frequency to choose. For +example, the powersave governor always chooses the lowest frequency +available, the performance governor the highest one. The userspace +governor makes no decision but chooses whatever the user (or a program in +userspace) wants - which means it reads the frequency from /sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed.

This doesn't sound like dynamic frequency changes yet and in fact it isn't. -Dynamics however can be accomplished with various approaches. For example, -the ondemand governor makes its decisions depending on the current CPU -load. The same is done by various userland tools like cpudyn, -cpufreqd, powernowd and many more. ACPI events can be used to -enable or disable dynamic frequency changes depending on power source. +Dynamics however can be accomplished with various approaches. For example, the +ondemand governor makes its decisions depending on the current CPU load. +The same is done by various userland tools like cpudyn, cpufreqd, +powernowd and many more. ACPI events can be used to enable or disable +dynamic frequency changes depending on power source.

@@ -513,8 +510,8 @@ Now play around with cpufreq-set to make sure frequency switching works. Run cpufreq-set -g ondemand for example to activate the ondemand governor and verify the change with cpufreq-info. If it doesn't work as -expected, you might find help in the Troubleshooting section -in the end of this guide. +expected, you might find help in the Troubleshooting +section in the end of this guide.

@@ -527,10 +524,10 @@ The above is quite nice, but not doable in daily life. Better let your system set the appropriate frequency automatically. There are many different approaches to do this. The following table gives a quick overview to help you -decide on one of them. It's roughly seperated in three categories -kernel for approaches that only need kernel support, daemon for -programs that run in the background and graphical for programs that -provide a GUI for easy configuration and changes. +decide on one of them. It's roughly seperated in three categories kernel +for approaches that only need kernel support, daemon for programs that +run in the background and graphical for programs that provide a GUI for +easy configuration and changes.

@@ -609,7 +606,8 @@ - ncpufreqd + ncpufreqd DaemonTemperature @@ -659,7 +657,7 @@ While adjusting the frequency to the current load looks simple at a first glance, it's not such a trivial task. A bad algorithm can cause switching between two frequencies all the time or wasting energy when setting frequency -to an unnecessary high level. +to an unnecessary high level.

@@ -749,10 +747,10 @@

Sometimes it can be desirable to select another policy than the daemon chooses, for example when battery power is low, but you know that AC will be available -soon. In that case you can turn on cpufreqd's manual mode with -cpufreqd-set manual and select one of your configured policies (as -listed by cpufreqd-get). You can leave manual mode by executing -cpufreqd-set dynamic. +soon. In that case you can turn on cpufreqd's manual mode with cpufreqd-set +manual and select one of your configured policies (as listed by +cpufreqd-get). You can leave manual mode by executing cpufreqd-set +dynamic.

@@ -776,8 +774,8 @@

-If /proc/cpuinfo doesn't get updated (see -Troubleshooting), monitor the CPU frequency with: +If /proc/cpuinfo doesn't get updated (see Troubleshooting), monitor the CPU frequency with:

@@ -787,8 +785,8 @@
 

Depending on your setup, CPU speed should increase on heavy load, decrease on no activity or just stay at the same level. When using cpufreqd and -verbosity set to 5 or higher in cpufreqd.conf you'll get additional -information about what's happening reported to syslog. +verbosity set to 5 or higher in cpufreqd.conf you'll get +additional information about what's happening reported to syslog.

@@ -801,11 +799,11 @@

-As you can see in figure 1.1, the LCD display -consumes the biggest part of energy (might not be the case for non-mobile -CPU's). Thus it's quite important not only to shut the display off when not -needed, but also to reduce it's backlight if possible. Most laptops offer the -possibility to control the backlight dimming. +As you can see in figure 1.1, the LCD +display consumes the biggest part of energy (might not be the case for +non-mobile CPU's). Thus it's quite important not only to shut the display off +when not needed, but also to reduce it's backlight if possible. Most laptops +offer the possibility to control the backlight dimming.

@@ -817,7 +815,7 @@

The first thing to check is the standby/suspend/off timings of the display. As this depends heavily on your windowmanager, I'll let you figure it out -yourself. Just two common places: Blanking the terminal can be done with +yourself. Just two common places: Blanking the terminal can be done with setterm -blank <number-of-minutesM>, setterm -powersave on and setterm -powerdown <number-of-minutesM>. For X.org, modify /etc/X11/xorg.conf similar to this: @@ -858,8 +856,9 @@ dimming settings via a tool, write a small script that dims the backlight in battery mode and place it in your battery runlevel. The following script should work on most IBM Thinkpads and Toshiba laptops. You've got to enable the -appropriate option in your kernel (IBM Thinkpads only). For Toshiba laptops, install -app-laptop/acpitool and skip configuration of ibm_acpi as described below. +appropriate option in your kernel (IBM Thinkpads only). For Toshiba laptops, +install app-laptop/acpitool and skip configuration of ibm_acpi as +described below.

@@ -884,8 +883,8 @@

This should work without error messages and a file /proc/acpi/ibm/brightness should be created after loading the -module. An init script will take care of choosing the brightness according -to the power source. +module. An init script will take care of choosing the brightness according to +the power source.

@@ -1030,8 +1029,9 @@
 

To disable atd as suggested in the example above, you would run rc-update del atd battery. Be careful not to disable services that are needed for -your system to run properly - lm-profiler is likely to generate some false -positives. Do not disable a service if you are unsure whether it's needed. +your system to run properly - lm-profiler is likely to generate some +false positives. Do not disable a service if you are unsure whether it's +needed.

@@ -1045,8 +1045,9 @@ services that write to your disk frequently - syslogd is a good candidate, for example. You probably don't want to shut it down completely, but it's possible to modify the config file so that "unnecessary" things don't get -logged and thus don't create disk traffic. Cups writes to disk periodically, -so consider shutting it down and only enable it manually when needed. +logged and thus don't create disk traffic. Cups writes to disk +periodically, so consider shutting it down and only enable it manually when +needed.

@@ -1066,8 +1067,8 @@
 
 
 

-The second possibility is using a small script and hdparm. Skip this if you -are using laptop-mode. Otherwise, create /etc/init.d/pmg_hda: +The second possibility is using a small script and hdparm. Skip this if +you are using laptop-mode. Otherwise, create /etc/init.d/pmg_hda:

@@ -1155,9 +1156,9 @@
 

In case you own an ATI graphics card supporting PowerPlay (dynamic clock scaling for the the graphics processing unit GPU), you can activate this -feature in X.org. Open /etc/X11/xorg.conf and add (or enable) -the DynamicClocks option in the Device section. Please notice that -this feature will lead to crashes on some systems. +feature in X.org. Open /etc/X11/xorg.conf and add (or enable) the +DynamicClocks option in the Device section. Please notice that this +feature will lead to crashes on some systems.

@@ -1225,7 +1226,7 @@
 plugged in. You cannot avoid this (nevertheless remove them in case they're not
 needed). Second, when there are USB devices plugged in, the USB host controller
 periodically accesses the bus which in turn prevents the CPU from going into
-sleep mode. The kernel offers an experimental option to enable suspension of 
+sleep mode. The kernel offers an experimental option to enable suspension of
 USB devices through driver calls or one of the power/state files
 in /sys.
 

@@ -1250,7 +1251,7 @@ ACPI defines different sleep states. The more important ones are

-
    +
    • S1 aka Standby
    • S3 aka Suspend to RAM aka Sleep
    • S4 aka Suspend to Disk aka Hibernate
    • @@ -1317,9 +1318,9 @@

-If you're still reading, it seems to work. You can also setup standby (S1) in -a similar way by copying ram.conf to standby.conf -and creating a symlink /usr/sbin/hibernate-standby pointing to +If you're still reading, it seems to work. You can also setup standby (S1) in a +similar way by copying ram.conf to standby.conf and +creating a symlink /usr/sbin/hibernate-standby pointing to /usr/sbin/hibernate. S3 and S4 are the more interesting sleep states due to greater energy savings however.

@@ -1344,17 +1345,17 @@

There are two different implementations for S4. The original one is swsusp, -then there is the newer suspend2 with a nicer interface (including -fbsplash support). A -feature comparison is available at the -suspend2 Homepage. There used to be Suspend-to-Disk (pmdisk), a fork of -swsusp, but it has been merged back. +then there is the newer suspend2 with a nicer interface (including fbsplash +support). A feature +comparison is available at the suspend2 +Homepage. There used to be Suspend-to-Disk (pmdisk), a fork of swsusp, +but it has been merged back.

Suspend2 is not included in the mainline kernel yet, therefore you either have -to patch your kernel sources with the patches provided by -suspend2.net or use +to patch your kernel sources with the patches provided by suspend2.net or use sys-kernel/suspend2-sources.

@@ -1368,7 +1369,7 @@ [*] Software Suspend (replace /dev/SWAP with your swap partition) (/dev/SWAP) Default resume partition - + (hibernate with suspend2) Software Suspend 2 --- Image Storage (you need at least one writer) @@ -1386,8 +1387,8 @@ of your swap partition in the kernel config, you can also pass it as a parameter with the resume=/dev/SWAP directive. If booting is not possible due to a broken image, use the noresume kernel parameter. The -hibernate-cleanup init script invalidates swsusp images during the -boot process. +hibernate-cleanup init script invalidates swsusp images during the boot +process.

@@ -1404,7 +1405,7 @@
 commands to have cached data written to disk. First try it outside of X, then
 with X running, but not logged in.
 
- 
+
 

If you experience kernel panics due to uhci or similar, try to compile USB support as module and unload the modules before sending your laptop to sleep @@ -1423,9 +1424,9 @@

-The first part of the configuration is similar to the configuration of -swsusp. In case you didn't store the location of your swap partition in the -kernel config, you have to pass it as a kernel parameter with the +The first part of the configuration is similar to the configuration of swsusp. +In case you didn't store the location of your swap partition in the kernel +config, you have to pass it as a kernel parameter with the resume2=swap:/dev/SWAP directive. If booting is not possible due to a broken image, append the noresume2 parameter. Additionally, the hibernate-cleanup init script invalidates suspend2 images during the @@ -1436,9 +1437,10 @@ # rc-update add hibernate-cleanup boot

-

Now edit /etc/hibernate/hibernate.conf, enable the -suspend2 section and comment everything in the sysfs_power_state -and acpi_sleep sections. Do not enable the fbsplash part in global +

+Now edit /etc/hibernate/hibernate.conf, enable the suspend2 +section and comment everything in the sysfs_power_state and +acpi_sleep sections. Do not enable the fbsplash part in global options yet.

@@ -1449,9 +1451,10 @@

-Please configure fbsplash now if you didn't do already. To enable fbsplash -support during hibernation, the sys-apps/suspend2-userui package is -needed. Additionally, you've got to enable the fbsplash USE flag. +Please configure fbsplash now if you didn't do already. To enable +fbsplash support during hibernation, the sys-apps/suspend2-userui +package is needed. Additionally, you've got to enable the fbsplash USE +flag.

@@ -1473,8 +1476,7 @@
 If you don't want a black screen in the first part of the resume process, you
 have to add the suspend2ui_fbsplash tool to your initrd image. Assuming
 you created the initrd image with splash_geninitramfs and saved it as
-/boot/fbsplash-emergence-1024x768, here's how to do
-that.
+/boot/fbsplash-emergence-1024x768, here's how to do that.
 

@@ -1489,8 +1491,8 @@
 

-Afterwards adjust grub.conf respectively lilo.conf -so that your suspend2 kernel uses +Afterwards adjust grub.conf respectively lilo.conf so +that your suspend2 kernel uses /boot/fbsplash-suspend2-emergence-1024x768 as initrd image. You can now test a dry run to see if everything is setup correctly.

@@ -1552,8 +1554,8 @@

A: Probably you have activated symmetric multiprocessing support (CONFIG_SMP) in your kernel. Deactivate it and it should work. Some older -kernels had a bug causing this. In that case, run emerge x86info, -update your kernel as asked and check the current frequency with +kernels had a bug causing this. In that case, run emerge x86info, update +your kernel as asked and check the current frequency with x86info -mhz.

@@ -1602,15 +1604,15 @@

-Q: My system logger reports things like "logger: ACPI group battery / action -battery is not defined". +Q: My system logger reports things like "logger: ACPI group battery / +action battery is not defined".

-A: This message is generated by the /etc/acpi/default.sh script -that is shipped with acpid. You can safely ignore it. If you like to get rid of it, -you can comment the appropriate line in /etc/acpi/default.sh as shown -below: +A: This message is generated by the /etc/acpi/default.sh +script that is shipped with acpid. You can safely ignore it. If you like to get +rid of it, you can comment the appropriate line in +/etc/acpi/default.sh as shown below:

@@ -1627,13 +1629,14 @@
 

-Q: I activated the DynamicClocks option in xorg.conf and -now X.org crashes / the screen stays black / my laptop doesn't shutdown +Q: I activated the DynamicClocks option in xorg.conf +and now X.org crashes / the screen stays black / my laptop doesn't shutdown properly.

-A: This happens on some systems. You have to disable DynamicClocks. +A: This happens on some systems. You have to disable +DynamicClocks.

@@ -1642,7 +1645,7 @@

-A: If there is enough free space on your system, you can use the +A: If there is enough free space on your system, you can use the filewriter instead of the swapwriter. The hibernate-script supports it as well. More information can be found in /usr/src/linux/Documentation/power/suspend2.txt. @@ -1655,7 +1658,7 @@

A: First follow your manufacturer's advice on how to charge the battery -correctly. +correctly.

@@ -1683,10 +1686,10 @@

A: Don't fear to contact me, Dennis -Nienhüser, directly. The -Gentoo Forums are a good place to -get help as well. If you prefer IRC, try the #gentoo-laptop channel at -irc.freenode.net. +Nienhüser, directly. The Gentoo +Forums are a good place to get help as well. If you prefer IRC, try the +#gentoo-laptop channel at irc.freenode.net.

-- gentoo-doc-cvs@gentoo.org mailing list