v2.6.21 had started search for application which do unnecessary [https://fedoraproject.org/wiki/Releases/FeatureFixWakeups wakeups].

v2.6.21 had started search for application which do unnecessary [https://fedoraproject.org/wiki/Releases/FeatureFixWakeups wakeups].

All these fixes should save power and money - [https://fedoraproject.org/wiki/SIGs/PowerManagement/RHEL5xF12comparison comparison].

All these fixes should save power and money - [https://fedoraproject.org/wiki/SIGs/PowerManagement/RHEL5xF12comparison comparison].

−

−

== Reduced disk and network IO ==

−

Reduced disk and network IO is mainly associated with the two new systemtap scripts: diskdevstat and netdevstat. In order to reduce user's disk and/or network IO it is firstly needed to know what causes it, and with those 2 scripts that can be easily done.

−

The main problems were reported in [[https://bugzilla.redhat.com/show_bug.cgi?id=454582 bugzilla]]

−

So the main point here is that any unnecessary IO will cause the disk and/or network card to wake up from a suspended state which will cause higher overall power usage. And of course we want to avoid that. More details can be found in the doc/README.utils document from tuned.

−

−

== Intelligent drive spindown ==

−

The disk monitoring and tuning plugin in tuned take care about this problem. The idea is to monitor disk activity and activate the higher power management features if the disk isn't used for a while and even allow it to spin down. In case disk activity increases again we deactivate them again.

== Initscripts ==

== Initscripts ==

Line 53:

Line 44:

Tuned contains few profiles for different use-cases. They can be set or changed by tuned-adm utility.

Tuned contains few profiles for different use-cases. They can be set or changed by tuned-adm utility.

+

+

=== Intelligent drive spindown ===

+

The disk monitoring and tuning plugin in tuned take care about this problem. The idea is to monitor disk activity and activate the higher power management features if the disk isn't used for a while and even allow it to spin down. In case disk activity increases again we deactivate them again.

+

+

=== Reduced disk and network IO ===

+

The netdevstat and diskdevstat are two systemtap tools that allow the user to

+

collect detailed information about network and disk activity of all

+

applications running on a system. These two tools were inspired by powertop,

+

which shows number of wakeups for every application per second.

+

+

The basic idea is to collect statistic about the running applications in

+

a form that allows a user to identify power greedy applications.

+

That means f.e. instead of doing fewer and bigger IO operations they

+

do more and smaller ones. Current monitoring tools show typically only

+

the transfer speeds, which isn't very meaningful in that context.

+

+

Both utilities are part of tuned-utils package. They can be executed as

{{admon/caution|Missing information|There should be added definition for every profile - best use-case.}}

+

is providing various profiles. At the moment (2009 October 21) exist these:

* default

* default

+

used as default after starting tuned service.

* desktop-powersave

* desktop-powersave

+

is proper profile for a desktop.

* laptop-ac-powersave

* laptop-ac-powersave

+

is obviously laptop on adapter. It extended the battery live especially, when user wouldn't use laptop at battery.

* laptop-battery-powersave

* laptop-battery-powersave

−

* latency-performance

+

is obviously a laptop on battery in power-saving mode.

−

* server-powersave

+

* server-powersave

+

is proper profile for a server without any specifically defined functionality.

* throughput-performance

* throughput-performance

+

* latency-performance

+

are special profiles for servers aimed to specific function.

* spindown-disk

* spindown-disk

+

doesn't use tuned but it used various sysctl values to maximalize time when the disk is idle.

+

+

<pre>

+

tuned-adm list

+

</pre>

+

and now pick one of them

+

<pre>

+

tuned-adm profile picked-profile

+

</pre>

+

+

When loading profile eexecutes a script that will be executed after switching to a current profile, e.g. you can use tuned laptop-battery-powersave profile with Powersave profiles by settiong this value to: "tuned-adm profile laptop-battery-powersave"

+

For Performance profile is suggested run

+

<pre>

+

tuned-adm off

+

</pre>

+

+

Each profile is using ktune for setting various sysctl values which assure optimal time for writing on disk etc. Tuned is setting automatically disk, net and cpu settings. Details about possible values and enhancement could be found [[https://fedoraproject.org/wiki/SIGs/PowerManagement/TunablesMeasurement here]].

* framework - responsible for launching the workload, statistics and completing results. Framework behaviour can be adjusted in the configuration file bltk.conf. Configuration file is located in /etc directory by default. The file can be copied and adjusted in ~/.bltk then so defined configuration file has higher priority.

* workload - launch defined workload

* workload - launch defined workload

** idle - doing nothing for comparison with other profiles

** idle - doing nothing for comparison with other profiles

−

** office - editing files in oowriter

+

** office - editing files in writer, calc and paint

−

** player - using mplayer

+

** player - using player (totem by default)

−

** reader - reading document in Firefox

+

** reader - reading document (Firefox by default)

+

** custom - another workload can be defined

'''Workloads:'''

'''Workloads:'''

+

Idle for 2 minutes:

Idle for 2 minutes:

* bltk -I -T 120

* bltk -I -T 120

+

* WARNING - The option -T controls length of test only in Idle worklad. This option controls length of every cycle in other workloads (see below option -n <number of cycles>).

* The CD/DVD drive is used as a source to play by default. The source can be redirected in bltk.conf.

'''Measurement'''

'''Measurement'''

−

1. Switch off all applications even in tray e.g. players.

+

1. Turn off all applications even in tray e.g. players.

−

2. Open only a terminal.

+

2. Turn off screen saver.

−

3. Run the command and remove adapter from laptop.

+

3. Open only a terminal.

−

4. Statistics are usually stored in ~/.bltk directory.

+

4. Run the command and remove adapter from laptop.

+

5. Statistics are usually stored in ~/.bltk directory (see below).

+

+

'''Results'''

+

+

The results are stored in the path defined in bltk.conf. The default patch is:

+

+

''~/.bltk/<workload_name>.results[.<number>]''

+

+

e.g.

+

+

~/.bltk/idle.results

+

+

~/.bltk/idle.results.001

+

+

~/.bltk/office.results

+

+

~/.bltk/office.results.001

+

+

~/.bltk/office.results.002

+

+

'''Report'''

+

+

Result reporting command from bltk suite generates readable output.

+

* bltk_report [-o] <path to result>

+

* The option -o redirects output to stdout. The default output file is 'Report' located in result directory.

−

It generates a lot of output files with detail of measurement but the most important

+

'''Man pages'''

−

is called ''stat.log'' which shows the power consumption of battery and CPUs.

+

−

Another command from bltk suite generate readable output.

+

There are available man pages for bltk, bltk.conf and bltk_report.

−

* bltk -o

+

== Power Managment tools ==

== Power Managment tools ==

Line 295:

Line 402:

special behaviour of system is needed.

special behaviour of system is needed.

−

''When loading profile execute'' executes a script that will be executed after switching to a current profile.

+

''When loading profile execute'' a script that will be executed after switching to a current profile.

''Capabilities''

''Capabilities''

Line 306:

Line 413:

=== GNOME Power Manager ===

=== GNOME Power Manager ===

[http://projects.gnome.org/gnome-power-manager/gpp.html g-p-g]

[http://projects.gnome.org/gnome-power-manager/gpp.html g-p-g]

+

+

== IPMI ==

+

+

On some Dell machines (known to work is Dell !PowerEdge R610) you can get power information using IPMI. Note that these are vendor extensions that are not supported by ipmitool - you need to install freeipmi. And of course IPMI must be running (<code>service ipmi start</code>).

+

+

Some examples:

+

+

<pre>

+

# ipmi-oem dell get-instantaneous-power-consumption-info

+

Instantaneous Power : 128 W

+

Instantaneous Amps : 0.60 A

+

</pre>

+

+

<pre>

+

# ipmi-oem dell get-average-power-history

+

Last Minute Average Power : 127 W

+

Last Hour Average Power : 127 W

+

Last Day Average Power : 128 W

+

Last Week Average Power : 116 W

+

</pre>

+

+

<pre>

+

# ipmi-oem dell get-peak-power-history

+

Last Minute Max Power : 132 W

+

Last Minute Max Power Time : 02/02/10 - 03:09:33

+

Last Hour Max Power : 140 W

+

Last Hour Max Power Time : 02/02/10 - 02:09:01

+

Last Day Max Power : 194 W

+

Last Day Max Power Time : 02/01/10 - 04:07:23

+

Last Week Max Power : 256 W

+

Last Week Max Power Time : 02/02/10 - 16:39:11

+

</pre>

+

+

<pre>

+

# ipmi-oem dell get-power-headroom-info

+

Instantaneous Power Headroom : 503 W

+

Peak Power Headroom : 370 W

+

</pre>

+

+

<pre>

+

# ipmi-oem dell get-power-info

+

Cumulative Energy Start Time : 04/30/09 - 04:37:36

+

Cumulative Energy : 688.18 kWh

+

Peak Amp Time : 04/27/09 - 08:12:28

+

Peak Amp : 2.10 A

+

Peak Watt Time : 01/14/10 - 12:54:35

+

Peak Watt : 260 W

+

</pre>

+

+

See <code>man ipmi-oem</code> for details.

== Tips & tricks ==

== Tips & tricks ==

−

* switch to lightweight desktop Xfce?

+

It is possible to create profiles but some things can't be done by application automatically.

−

* switch off all unused e.g USB devices

+

List of tips which can help on laptop/server or both:

+

* For proper job proper system e.g. light Desktop or switch off useless effects on battery

+

* Consolidate number of needed/running services

+

* Enforce turning of machines that are not used (e.g. company policy).

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)

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.
Devices could be handled by plugins which are currently providing
ethernet network, ATA harddisk devices and cpu tuning.

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

Tuned daemon contains two main parts:

scripts for observing state of hardware/resources which is processed by plugins

ktune for setting up sysctl and other values provided by kernel

With the default setting are switched on all plugins namely:

net - switch ethernet card to slower transmission rate

cpu - set value of DMA latency

disk - lower/higher spindown value of disk (only for ATA)

Tuned contains few profiles for different use-cases. They can be set or changed by tuned-adm utility.

The disk monitoring and tuning plugin in tuned take care about this problem. The idea is to monitor disk activity and activate the higher power management features if the disk isn't used for a while and even allow it to spin down. In case disk activity increases again we deactivate them again.

The netdevstat and diskdevstat are two systemtap tools that allow the user to
collect detailed information about network and disk activity of all
applications running on a system. These two tools were inspired by powertop,
which shows number of wakeups for every application per second.

The basic idea is to collect statistic about the running applications in
a form that allows a user to identify power greedy applications.
That means f.e. instead of doing fewer and bigger IO operations they
do more and smaller ones. Current monitoring tools show typically only
the transfer speeds, which isn't very meaningful in that context.

Both utilities are part of tuned-utils package. They can be executed as

PID: Process ID of the application
UID: User ID under which the applications is running
DEV: Device on which the IO took place
WRITE_CNT: Total number of write operations
WRITE_MIN: Lowest time in seconds for 2 consecutive writes
WRITE_MAX: Largest time in seconds for 2 consecutive writes
WRITE_AVG: Average time in seconds for 2 consecutive writes
READ_CNT: Total number of read operations
READ_MIN: Lowest time in seconds for 2 consecutive reads
READ_MAX: Largest time in seconds for 2 consecutive reads
READ_AVG: Average time in seconds for 2 consecutive reads
COMMAND: Name of the process

Example of measurement with chosen worst doing applications:

PID

UID

DEV

WRITE_CNT

WRITE_MIN

WRITE_MAX

WRITE_AVG

READ_CNT

READ_MIN

READ_MAX

READ_AVG

COMMAND

2789

2903

sda1

854

0.000

120.000

39.836

0

0.000

0.000

0.000

plasma

2573

0

sda1

63

0.033

3600.015

515.226

0

0.000

0.000

0.000

auditd

2153

0

sda1

26

0.003

3600.029

1290.730

0

0.000

0.000

0.000

rsyslogd

Those are the 3 applications that have a WRITE_CNT > 0, meaning they performed
some form of write during the measurement. Of those, plasma was the worst
offender by a large amount. For one in total number of writes and of course
the average time between writes was also the lowest. This would be the best
candidate to investigate if you're concerned about power inefficient
applications.

Missing informationThere should be added definition for every profile - best use-case.

is providing various profiles. At the moment (2009 October 21) exist these:

default

used as default after starting tuned service.

desktop-powersave

is proper profile for a desktop.

laptop-ac-powersave

is obviously laptop on adapter. It extended the battery live especially, when user wouldn't use laptop at battery.

laptop-battery-powersave

is obviously a laptop on battery in power-saving mode.

server-powersave

is proper profile for a server without any specifically defined functionality.

throughput-performance

latency-performance

are special profiles for servers aimed to specific function.

spindown-disk

doesn't use tuned but it used various sysctl values to maximalize time when the disk is idle.

tuned-adm list

and now pick one of them

tuned-adm profile picked-profile

When loading profile eexecutes a script that will be executed after switching to a current profile, e.g. you can use tuned laptop-battery-powersave profile with Powersave profiles by settiong this value to: "tuned-adm profile laptop-battery-powersave"
For Performance profile is suggested run

tuned-adm off

Each profile is using ktune for setting various sysctl values which assure optimal time for writing on disk etc. Tuned is setting automatically disk, net and cpu settings. Details about possible values and enhancement could be found [here].

Scomes is a part of tuned-utils utilities which is based on SystemTap script for watching system resources.

SystemTap scripts need kernel-debuginfo matching to actual kernel. A current kernel version could be obtain by:

uname -a

Debuginfo will be installed by:

debuginfo-install kernel

A binary must have unique name or there are no other binaries with same name on the system.
Execution of scomes:

scomes.stp -c "<binary> [<binary arg> ...]" <timer>

binary [binary args ...] - executable file, arguments are optional

timer - in seconds displays only final result when timer is 0. In other cases it displays actual output every N seconds.

The measurement can take a while. It is possible to use timer for actual result. SystemTap executes
scripts under root or it is needed add current user
into group systemtap. Since SystemTap v1.0 should
be possible running scripts as a normal user.

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 - flash application can be very power hungry

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.

Battery Life Tool Kit provides reproducible loads which can simulate tasks and measure power performance of system running on battery.
The tool can be stared on the desktop too. There is necessary to use -a option that turns off handling battery info of course unavailable on the desktop.

BLTK has two parts:

framework - responsible for launching the workload, statistics and completing results. Framework behaviour can be adjusted in the configuration file bltk.conf. Configuration file is located in /etc directory by default. The file can be copied and adjusted in ~/.bltk then so defined configuration file has higher priority.

workload - launch defined workload

idle - doing nothing for comparison with other profiles

office - editing files in writer, calc and paint

player - using player (totem by default)

reader - reading document (Firefox by default)

custom - another workload can be defined

Workloads:

Idle for 2 minutes:

bltk -I -T 120

WARNING - The option -T controls length of test only in Idle worklad. This option controls length of every cycle in other workloads (see below option -n <number of cycles>).

The CD/DVD drive is used as a source to play by default. The source can be redirected in bltk.conf.

Measurement

1. Turn off all applications even in tray e.g. players.
2. Turn off screen saver.
3. Open only a terminal.
4. Run the command and remove adapter from laptop.
5. Statistics are usually stored in ~/.bltk directory (see below).

Results

The results are stored in the path defined in bltk.conf. The default patch is:

~/.bltk/<workload_name>.results[.<number>]

e.g.

~/.bltk/idle.results

~/.bltk/idle.results.001

~/.bltk/office.results

~/.bltk/office.results.001

~/.bltk/office.results.002

Report

Result reporting command from bltk suite generates readable output.

bltk_report [-o] <path to result>

The option -o redirects output to stdout. The default output file is 'Report' located in result directory.

First of all it is needed Let PowerDevil manage screen powersaving on.
Then can be enabled other things.
Lock screen on resume is safety feature, it will asked for a password after
display goes to power saving mode. When Enable warning notifications are enabled then
a user is noticed about changes related to power management.
For every issue can be set in Configure Notification action e.g. play sound,
when suspend will be done. Here can be also set waiting before suspend action.

Profile Assignment

There are pre-set profiles for every action in regard to usage or state of battery.
Performance profile is most suitable for laptop on Adaptor or for desktop computer,
but that doesn't mean they can't use power saving options. The other profiles should
be specified by users for their needs.

Advanced Battery Settings

Here can be redefined levels of battery capacity. For example if the battery is broken
or old, it could be better to move low level at higher percentage.

Edit Profiles

Actions

For every profile exists set of settings. Disable desktop effects is suggested for
all profiles except Performance profile. Dim display when idle for more than depends
on hardware because some displays dim automatically when they are not on adaptor. Display is
consuming most of the power, so it's recommended set this option for all power-saving profiles.
When the system is idle option can be used for locking the session, turning off screen, suspend
etc. Although here can be defined actions for laptop lid closed or pressing sleep/power button.
This feature is more user-friendly than to save power.

Screen

From power management point of view is better to use automatically standby, suspend or power off
than screen-saver. Especially when is screen-savers based on e.g. OpenGL, then it's power hungry application.
Brightness of screen can be hardware dependent and some screens are changing brightness automatically.

CPU and System

This part is fully dependent on hardware possibilities of a current computer.
In case there exist more than one CPU, then it is possible to switch it off. This usually doesn't apply
for two core CPUs. CPU frequency scaling policy offers various modes executed by (kernel) governor.
Available governors are stored for appropriate cpu here:

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors

The default values is ondemand governor which keeps the system’s speed at maximum unless it is pretty
sure that the system is idle. Therefore this will be the mode that will save power with the least performance impact.
On demand governor is "predicting" future load of CPUs, so it is not recommended to change the governor mode unless
special behaviour of system is needed.

When loading profile execute a script that will be executed after switching to a current profile.

Capabilities

Display system capabilities from directory /proc in human readable format.

On some Dell machines (known to work is Dell !PowerEdge R610) you can get power information using IPMI. Note that these are vendor extensions that are not supported by ipmitool - you need to install freeipmi. And of course IPMI must be running (service ipmi start).

# ipmi-oem dell get-average-power-history
Last Minute Average Power : 127 W
Last Hour Average Power : 127 W
Last Day Average Power : 128 W
Last Week Average Power : 116 W

# ipmi-oem dell get-peak-power-history
Last Minute Max Power : 132 W
Last Minute Max Power Time : 02/02/10 - 03:09:33
Last Hour Max Power : 140 W
Last Hour Max Power Time : 02/02/10 - 02:09:01
Last Day Max Power : 194 W
Last Day Max Power Time : 02/01/10 - 04:07:23
Last Week Max Power : 256 W
Last Week Max Power Time : 02/02/10 - 16:39:11