Powertop linux ��� ���

Экономия заряда батареи ноутбука с помощью утилиты powertop

Оригинал: Saving laptop power with powertop
Автор: Paul W. Frields
Дата публикации: 11 июня 2015 г.
Перевод: А.Панин
Дата перевода: 5 августа 2015 г.

Экономия заряда батареи ноутбука с помощью утилиты powertop

Если вы судите о ноутбуках по одному параметру, скорее всего данным параметром является время автономной работы от батареи. Вам наверняка хотелось бы более продуктивно использовать каждый ампер-час для увеличения времени, которое можно потратить на работу, чтение или просто на развлечения. Поэтому неплохо узнать, на что расходуется заряд батареи ноутбука.

Вы можете использовать утилиту powertop для ознакомления со списком потребителей заряда батареи в процессе автономной работы системы. Данная утилита исполняется в терминале, поэтому вам придется самостоятельно запустить эмулятор терминала. После этого следует выполнить в нем следующую команду:

Утилите powertop необходим доступ к аппаратному обеспечению для осуществления замеров расхода энергии батареи. Исходя из этого, вам придется запускать данную утилиту также с повышенными привилегиями:

Вывод утилиты powertop должен быть аналогичен выводу, представленному на рисунке ниже. Потребление энергии в рамках вашей системы с высокой вероятностью будет отличаться:

Утилита выводит данные в рамках нескольких экранов. Вы можете переключаться между ними с помощью клавиши Tab и сочетания клавиш Shift+Tab . Для завершения работы утилиты следует использовать клавишу Esc . Список горячих клавиш также приведен в нижней части экрана для удобства пользователей.

Утилита выводит информацию об использовании заряда батареи различными аппаратными устройствами и драйверами. При этом она также выводит значения любопытных параметров, таких, как количество обрабатываемых в течение секунды прерываний. (Современные центральные процессоры являются настолько быстрыми, что обычно бездействуют в течение большей части секундного интервала.)

Если вы желаете максимизировать заряд батареи, вам следует минимизировать количество операций по переводу центрального процессора из режима энергосбережения в стандартный режим работы. Одним из способов соответствующей минимизации является использование страницы параметров настройки системы «Tunables» утилиты powertop . Метка «Bad» используется для указания на значение параметра, которое не способствует экономии заряда батареи, хотя и может способствовать повышению быстродействия системы. Метка «Good» используется для указания на значение параметра, соответствующее режиму энергосбережения. Вы можете использовать клавишу Enter для изменения каждого изменяемого значения параметра.

Пакет программного обеспечения powertop также содержит службу, которая автоматически устанавливает отмеченные с помощью меток «Good» оптимальные значения параметров настройки системы с целью перевода системы в оптимальный режим энергосбережения. Для ее запуска следует выполнить следующую команду:

Если вы желаете, чтобы данная служба запускалась автоматически после загрузки системы, выполните следующую команду:

Предостережение относительно использования данной службы для установки значений параметров настройки системы: Некоторые значения параметров настройки системы могут привести к повреждению пользовательских данных или (при использовании некоторого специфического оборудования) к некорректной работе системы. К примеру, установка значения параметра «VM writeback timeout» влияет на длительность периода ожидания перед записью измененных данных на устройство хранения данных. Следовательно, значение данного параметра является компромиссом между энергоэффективностью системы и безопасностью хранения данных. В том случае, если энергоснабжение системы будет по какой-либо причине полностью нарушено, вы потеряете изменения данных за последние 15 секунд, а не за 5 секунд, как при использовании стандартных параметров системы. Однако, для большинства пользователей ноутбуков данная особенность работы системы не является проблемой, так как система в любом случае выведет предупреждение о критическом снижении заряда батареи.

Читайте также:  Native instruments kore 2 mac os

Источник

Powertop

Powertop is a tool provided by Intel to enable various powersaving modes in userspace, kernel and hardware. It is possible to monitor processes and show which of them are utilizing the CPU and wake it from its Idle-States, allowing to identify applications with particular high power demands.

Contents

Installation

Usage

Powertop suggests a few methods to reduce the power consumption further. However, in interactive mode, powertop does not display the parameters. To find out which ones are suggested, proceed as follows:

  1. If you have changed parameters (e.g. in powertop), reboot so that the system has default state of the parameters.
  2. Use powertop to produce a report on parameters: powertop —html=powerreport.html (as the root user)
  3. Open the report in your favorite web browser. The «Tuning» tab of the report now shows the actual parameters suggested by the tool to apply to save power. You may extract the commands with awk -F ‘ ‘ ‘/tune/ < print $4 >‘ powerreport.html .

Apply settings

There are two ways to automatically apply the suggested settings:

  • Recommended: You can apply these settings at boot by using module parameters, udev rules and sysctl. For details, see the power management page.
  • You can use the —auto-tune feature from powertop which sets all tunable options to their GOOD setting. This can be combined with systemd service to have the tunables set on boot. Remember to enable/start the service.

Troubleshooting

Error: Cannot load from file

If you receive an error like the following when starting powertop, it is likely that powertop has not collected enough measurement data yet. To fix this, keep powertop running for a certain time connected to battery power only.

Calibration to prevent inaccurate measurement

If you experience inaccurate measurement, then it is likely that you need to calibrate powertop first. This can be done by running powertop with the —calibrate parameter.

Источник

How to Install and Use Powertop on Ubuntu 16.04/20.04

Powertop is a tool that was developed by Intel to enable various power-saving modes in kernel, userspace, and hardware. Powertop helps you monitor processes and get each process CPU utilization and wake it from its Idle-States. This allows you to identify applications that have high power demands and kill their processes if not necessary.

PowerTOP Linux utility can monitor and display a system’s electrical power usage. This makes it a very useful hardware monitoring and diagnostic tool. It is among the most powerful battery stretching utilities for notebook computers. This tool is supported by Intel, AMD, ARM, and UltraSparc processors.

Installing Powertop on Ubuntu 16.04/20.04

Powertop package is available on upstream Ubuntu 16.04/20.04 repositories. Easily install it from apt-get package management tool.

This installation provides you with a command-line tool called powertop which is used to check and monitor power usage.

Accessing PowerTOP Tunables

Let’s cover some few examples on how to use Powertop. Before you start making any changes, it is a good idea to first get a baseline for what your current power consumption is. It needs superuser privileges hence sudo command must be used.

This is the default mode to execute PowerTOP. It will open an n-curses interface that hosts Powertop’s interactive mode. Note that you must be running on battery power for Powertop to get the machine’s current watt usage. Once the application is launched, you may tab over to the Tunables section to adjust the power management setting for each item in the list.

From the layout, under Tunables tab is a list of the devices that are present on the system. Devices that are not tuned for power management have the “Bad” label associated. Otherwise, the label reads “Good”.

Читайте также:  Fluxion kali linux github

To navigate, use the tab key to visit the different menu items. Use the arrow keys to navigate vertically on a page and the enter key to change the configuration of the items under Tunables.

Powertop operation modes

There are other modes you can start Powertop in apart from interactive one. Namely

HTML mode

This feature executes PowerTOP and stores the result in the powertop.html file:

CSV mode

In this mode, the output is given in CSV format with the default name of powertop.csv if no name is given:

Calibrate mode

Calibrate mode measures power for a set of runs using different idle settings for USB devices, radios, backlight, wifi, disk, and the CPU.

Auto-Tune mode

This feature sets all tunable options to their GOOD setting without additional user intervention.

Workload mode

Good for benchmarks. It executes a workload and identifies the power consumption of the system during the execution of the workload.

Uninstalling Powertop on Ubuntu 16.04

If you no longer need this tool and feel like uninstalling it, without touching any configuration file, run:

To remove powertop package and its dependencies, you’ll need to run:

If you had to remove the powertop package only and now need to clear its configuration files and data, use:

Wrapping Up

Powertop is a nice tool for Laptop users keen at maximum power efficiency. By filtering applications which are more power intensive, it becomes easy to retain only useful and productive apps. If you’re a developer, you can as well extend its functionalities to achieve more.

Источник

Экономия энергии в Linux на платформе Intel

Требования

Для использования утилиты необходимо наличие ядра с незафиксированным временем тика (NO_HZ), а это ядра, начиная с версии 2.6.21.
На данный момент есть поддержка только 32-х разрядной архитектуры, 64-х битная будет поддерживаться начиная с ядра 2.6.23.
Ну и конечно же, PowerTOP лучше всего запускать на портативных компьютерах, или компьютерах с мобильными версиями процессоров от Intel. Для запуска программы, надо переключиться на работу от батареи!

Краткая информация

Вот приведен снимок экрана с запущенной утилитой:

C-State

C-State – это режим работы процессора. Чем больше число, тем меньше энергии потребляет компьютер, но тем дольше ему надо будет расчехляться, что б заработать на полную мощность.
С0 – это состояние, когда процессор исполняет команды. Во всех других режимах, процессор – простаивает.
Для получения наиболее впечатляющих результатов энергосбережения, процессор должен находиться в состоянии С3 или С4 большую часть времени простоя. Чем больше среднее время процессор находиться в подобном состоянии, тем больше энергии он сохранит. Идеально было бы, если б 95% времен процессор находился в состоянии С4, на среднее время от 50 миллисекунд.
На картинке мы видим, что дела у лэптопа не особо хороши. Большую часть времени он проводит в режиме С2 и то, только на среднее время 4,4 миллисекунды. Если же лэптоп будет проводить большую часть времени в режиме С4, хотя бы на среднее время 20 миллисекунд, это должно увеличить жизнь батареи приблизительно на 1 час.

Пробуждения в секунду (Wakeups per second)

Пробуждения в секунду – это еще один показатель работы вашего лэптопа в плане экономии энергии. Чем меньше число, тем лучше. Когда вы запустили стандартный GNOME, то 3 пробуждения в секунду – это допустимо. На лэптопе с картинки, видно, что 193 – гораздо больше трёх, что вполне совпадает с показателями С-режима.

Использование батареи (Power usage)

При запуске утилиты, если вы прислушались к рекомендациям и работаете от батареи, то можно увидеть некоторую дополнительную информацию. Утилита обращается к ACPI, для сбора информации о текущем потреблении энергии, а также выводит информацию о предположительном времени жизни батареи (не вообще, а на этой зарядке).
Если вы не послушались и не запустили на компьютере работающем от батареи, такой интересной информации вы не увидите!

Читайте также:  Редактор efi загрузчика windows 10

Предпосылки для большого числа пробуждений в секунду

Теперь, мы видим, что подопытный лэптоп не очень хорошо работает в плане сохранения энергии. И теперь вот самая интересная часть: что же заставляет компьютер тратить больше энергии, чем нам хотелось бы.
Утилита покажет вам 10 самых активных компонентов системы или программ, которые заставляют ее так часто пробуждаться. На картинке, тремя самыми затратными вещами есть аппаратные прерывания от драйверов. Это показывает нам одно из упущений данного ноутбука – в то время, как он подключен в сети по кабелю, драйвер беспроводной сети (ipw2200) все еще очень часто отвлекает наш процессор. Так же можно увидеть ошибку графического драйвера i915 и активность компонента i8042 (это чип PS/2, показанная активность – результат движения мыши, для создания снимка экрана).
Картинка так же показывает, что Firefox, Xorg, xchat – очень активны и как результат сильно влияют на потреблении энергии компьютером.

Подсказки

В последней секции, утилита показывает вам подсказку – что текущее ядро сконфигурировано не оптимально и предлагается пути устранения этого недоразумения.

Источник

PowerTOP

PowerTOP is a Linux utility that can monitor and display a system’s electrical power usage. It is useful as a hardware monitoring and diagnostic tool. It is among the most powerful battery stretching utilities for notebook computers.

Contents

Installation

Kernel

Several kernel options must be enabled in the kernel for PowerTOP to work properly. These include: CONFIG_DEBUG_FS , CONFIG_TRACING , CONFIG_BLK_DEV_IO_TRACE , CONFIG_TIMER_STATS (was removed in kernel 4.11), CONFIG_CPU_FREQ_STAT , and CONFIG_CPU_FREQ_STAT_DETAILS (removed in 4.11, and rolled into CONFIG_CPU_FREQ_STAT ).

For newer Intel Core series of processors (based on the Sandy Bridge microarchitecture or newer) enable the powercap sysfs driver via CONFIG_POWERCAP and CONFIG_INTEL_RAPL .

Optionally, for wireless power saving enable: CONFIG_TRACEPOINTS .

If the above options have not properly been enabled Portage will display warning messages at the end of the emerge. If help is required for upgrading the kernel while enabling the above options, be sure to see the kernel upgrade article!

USE flags

USE flags for sys-power/powertop tool to diagnose issues with power consumption and power management

X Add support for X11
nls Add Native Language Support (using gettextGNU locale utilities)
unicode Add support for Unicode

Emerge

After setting USE flags, emerge PowerTOP:

Configuration

PowerTOP does not have any configuration other than passing options via the command-line.

Calibration

Calibration can be performed in order for PowerTOP to gain an understanding of the system:

Usage

Invocation

Troubleshooting

Could not find a Makefile in the kernel source directory

After an emerge a message similar to the following message may be displayed:

This warning indicates the PowerTOP ebuild has attempted to verify a successful operating environment for the PowerTOP software package. In order to be sure PowerTOP will work as intended, at the end of the emerge process, a check is ran against the current kernel source configuration. In the case of the above message two warnings were provided:

  1. No kernel sources have been detected. This can happen as a result of running an emerge —depclean or failed to have a specific kernel set using the eselect kernel command.
  2. Since no kernel sources have been detected Portage was not able to scan the kernel’s .config file to determine if the correct features have been enabled in the kernel. According to the error message above, five features are not set. The features may or may not be set in the current running kernel. Portage is simply making the user aware there is no way to verify these features have been set without a .config file. If PowerTOP can perform some functions but not others, be sure all the kernel features listed have been enabled. For more information on how to do so consult the kernel configuration article.

Источник

Оцените статью