⬆️ ⬇️

Energy Saving on Linux on Intel Platform

PowerTOP is a utility that allows you to detect components in your system that cause your laptop to consume more power than necessary during downtime.

Starting with kernel version 2.6.21 , Linux no longer has a fixed tick time of 1000 Hz. This theoretically should increase the battery life of the laptop, since the processor spends more time in low power mode when your system is idle.

The utility helps to identify the components of the kernel, as well as user programs, which are the largest expendables of computer energy.



Requirements



To use the utility, you must have a kernel with non-fixed tick time (NO_HZ), and these are kernels starting from version 2.6.21 .

At the moment there is support for only 32-bit architecture, 64-bit will be supported starting from kernel 2.6.23 .

And of course, PowerTOP is best run on laptops, or computers with mobile versions of processors from Intel. To run the program, you need to switch to battery life!



brief information



Here is a screen shot of the running utility:





C-state



C-State is the processor mode. The larger the number, the less energy the computer consumes, but the longer it will have to uncover, in order to earn full power.

C0 is the state when the processor executes commands. In all other modes, the processor is idle.

For the most impressive power savings results, the processor must be in the C3 or C4 state for most of its idle time. The longer the average time the processor is in a similar state, the more energy it will save. It would be ideal if 95% of the time the processor was in the C4 state, for an average time of 50 milliseconds.

In the picture, we see that the laptop is not very good. Most of the time he spends in C2 mode and then, only for an average time of 4.4 milliseconds. If the laptop spends most of the time in C4 mode, at least for an average time of 20 milliseconds, this should increase the battery life by about 1 hour.

')

Awakenings per second (Wakeups per second)



Awakening per second is another indicator of how your laptop works in terms of energy savings. The smaller the number, the better. When you start the standard GNOME , 3 wakes per second is acceptable. On the laptop from the image, it is clear that 193 is much more than three, which completely coincides with the C-mode indices.



Battery usage (Power usage)



When you run the utility, if you listened to the recommendations and work on battery, then you can see some additional information. The utility accesses the ACPI to collect information about current energy consumption, and also displays information about the estimated battery life time (not at all, but on this charge).

If you did not obey and did not run on a battery-powered computer, you will not see such interesting information!



Prerequisites for a large number of awakenings per second



Now, we see that the experimental laptop does not work very well in terms of energy conservation. And now here’s the most interesting part: what makes a computer spend more energy than we would like?!?

The utility will show you the 10 most active system components or programs that cause it to wake up so often. In the picture, the three most expensive things are hardware interrupts from drivers. This shows us one of the omissions of this notebook - while it is connected to the network via cable, the wireless driver ( ipw2200 ) is still very often distracted by our processor. You can also see the error of the graphic driver i915 and the activity of the component i8042 (this is a PS / 2 chip, the activity shown is the result of mouse movement to create a screen shot).

The picture also shows that Firefox, Xorg, xchat are very active and as a result have a strong influence on computer power consumption.



Tips



In the last section, the utility shows you a hint - that the current kernel is not optimally configured and suggests ways to eliminate this misunderstanding.



Download and install



Version 1.7 of the utility can be downloaded from here: www.linuxpowertop.org/download/powertop-1.7.tar.gz

The installation of the utility is standard for Linux:

tar -zxf powertop-1.7.tar.gz

cd powertop-1.7

make

make install

powertop

Source: https://habr.com/ru/post/31119/



All Articles