From Fedora Project Wiki
Line 119: Line 119:
'''Workloads:'''
'''Workloads:'''
Idle for 2 minutes:
Idle for 2 minutes:
{{{
* bltk -I -T 120  
bltk -I -T 120  
 
}}}
Reader, 4times:
Reader, 4times:
{{{
* bltk -R -n 4
bltk -R -n 4
 
}}}
Office work:
Office work:
{{{
* SAL_USE_VCLPLUGIN=gen bltk -O -n 1
SAL_USE_VCLPLUGIN=gen bltk -O -n 1
 
}}}
Play something:
Play something:
{{{
* bltk -P
bltk -P
}}}


'''Measurement'''
'''Measurement'''

Revision as of 07:08, 9 October 2009

DeploymentGuide

Power management topics

We as a BaseOS are probably interested only in these topics.

Power management in user space

1. Reduced wakeups
2. Reduced disk and network IO
3. Initscripts
4. Tuned
5. Powertop
6. BLTK
7. Intelligent drive spindown
8. tuned-adm
9. scomes?
10. Desktop tools - kpowerdevil, g-p-m and xfce something

Reduced wakeups

Measurements or simply short overview of bugs which were solved?

Initscripts

It was created a review of all initscripts because if user's would switch off unused services, they can reduce power consumption and make their boot faster. During the review was removed service bluetooth which is now switching on/off on demand that means every time the hardware is available. The other services couldn't be rewritten or removed. (Link to work with services in Deployment Guide)

Tuned

is a dynamic adaptive system tuning daemon that tunes system settings dynamically depending on usage. It does so by monitoring the usage of several system components periodically. Based on that information components will be put into lower or higher power saving modes to adapt to the current usage. Currently only ethernet network and ATA harddisk devices are implemented.

Tuned can be executed as a service:

service tuned start


After installation it is added into services started after boot. Tuned can run as a daemon, which is the default setting.

tuned -d

Tuned has optional path to configure file. The default is /etc/tuned.conf but user can change it by:

tuned -c /mypath/myconfigfile.conf

Powertop

is a linux tool which can find programmes that consume resources even if the computer is idle. The most resource consuming had been kernel but since version 2.6.21 is kernel tickless. PowerTOP is using various information provided by system. It combines all information and produce list of programmes which are more power hungry.

Basic goals of PowerTOP are:

* offer tips for low power consumption
* test application and their behaviour
* locate problematic applications

Introduction to statistics

States of CPU

C-states are idle states, P-states are operational. C0 means busy state of CPU, the other C-states mean CPU is idle. The higher percentage in C3 or C4 means that CPU is really saving some energy but it also means longer time when it comes back to C0 and executing instructions.

P-state shows the operational state, or the frequency the CPU is running at most of the time. Therefore if laptop is using low power profile and operating on battery, then OS will lower the C0 frequency and voltage which means CPU will be in higher P-state. Lower frequency means lower power. Reducing the voltage decreases the leakage current from the CPU's transistors, making the processor more energy efficient resulting in further gains.

Wakeups per second

should be small as much as possible. The wakeup is matching with C-state results.

Power usage

display information collected from ACPI in case laptop is on battery. It can measure how much time on battery is left.

Top causes for wakeups

In this part could be identified most power hungry application. Many application has been fixed to be more power friendly. As can be seen on the picture there are mostly hardware interrupts but also some user-space application. Example of dealing with problems:

* amarok - it can be used more power friendly player e.g. audacious is the best according power consumption
* npviewer.bin - whether is possible not using java plugins
* firefox - it might be fixed in future releases
* USB-devices - on picture it's mice. The best solution is aware of using all USB devices while saving the battery.

attachment:powertop.jpeg

Suggestions

Quite often it can be seen these which are displayed with solution:

* Disable 'hal' from polling your cdrom - cd/dvdrom won't be looking for new disc
* Enable USB autosuspend - not using USB devices or removing them can help
* Disable or remove 'pcscd' from your system - the same as USB

These things could help but they are often part of tuning profiles which can set a computer in lower power consumption state e.g. using tuned.

bltk

Battery Life Toolkit provides workloads which can simulate task and measure power performance of system running on battery.

BLTK has two parts:

* framework - responsible for launching the workload, statistics and completing results.
* workload - launch defined workload
 * idle - doing nothing for comparison with other profiles
 * office - editing files in oowriter
 * player - using mplayer
 * reader - reading document in Firefox

Workloads: Idle for 2 minutes:

  • bltk -I -T 120

Reader, 4times:

  • bltk -R -n 4

Office work:

  • SAL_USE_VCLPLUGIN=gen bltk -O -n 1

Play something:

  • bltk -P

Measurement

1. Switch off all applications even in tray e.g. players.
2. Open only a terminal.
3. Run the command and remove adapter from laptop.
4. Statistics are usually stored in ~/.bltk directory.

It generates a lot of output files with detail of measurement but the most important is called stat.log which shows the power consumption of battery and CPUs.

tuned-adm

This command line utility allows user to switch between user definable tuning profiles. Several predefined profiles are already included for some of the more common cases.

kpowerdevil

It can run scripts which are called from different profiles set in this application.