- Laptop Mode Tools (Русский)
- Contents
- Вступление
- Установка
- Включение и базовая настройка
- /etc/laptop-mode/laptop-mode.conf
- Тонкая настройка модулей
- Настройки ядра
- Процессор
- Управление частотой процессора
- Многоядерные процессоры
- Laptop Mode Tools
- Contents
- Installation
- Configuration
- Hard disks
- Solid state drives
- CPU frequency
- Device and bus
- Intel SATA
- USB autosuspend
- Display and graphics
- LCD brightness
- Terminal blanking
- Networking
- Ethernet
- Wireless LAN
- Audio
- Intel HDA
- Troubleshooting
- Laptop-mode-tools is not picking up events
- USB Mouse sleeping after 5 seconds when on battery
- Issues with NVIDIA driver
- KDE shows black screen
- Laptop Mode Tools
- Contents
- Installation
- Configuration
- Hard disks
- Solid state drives
- CPU frequency
- Device and bus
- Intel SATA
- USB autosuspend
- Display and graphics
- LCD brightness
- Terminal blanking
- Networking
- Ethernet
- Wireless LAN
- Audio
- Intel HDA
- Troubleshooting
- Laptop-mode-tools is not picking up events
- USB Mouse sleeping after 5 seconds when on battery
- Issues with NVIDIA driver
- KDE shows black screen
Laptop Mode Tools (Русский)
Перевод этой статьи или раздела не отражает оригинальное содержание.
Laptop Mode Tools — набор инструментов для гибкого управления энергосбережением.
Contents
Вступление
Изначально Linux использовался в основном на настольных компьютерах и серверах, энергоэффективноть которых не была приоритетной задачей. Однако, с появлением компактных переносимых рабочих станций, питающихся от аккумуляторных батарей — ноутбуков, проблема излишней «прожорливости» систем встала довольно остро. Начиная с версии 2.4.43 в ядре была предпринята попытка реализовать «режим ноутбука» (англ. laptop mode). То есть такой режим, при котором бы снижалось энергопотребление и увеличивалось время автономной работы от батареи. Впервые ядро могло позволить жесткому диску останавливаться чаще, что и экономило энергию. Однако это требовало довольно серьезной настройки и до версии 2.6.6 laptop mode был не слишком популярен.
Однако прошло время, было придумано множество аппаратных и программных решений для экономии энергии. Из простой программы, контролирующей жёсткие диски, сформировался достаточно мощный и гибкий инструмент — Laptop Mode Tools. LMT реализует энергоэффективное управление несколькими подсистемами компьютера одновременно. Совместно с acpid, cpufrequtils и pm-utils [archived page] LMT представляет собой полноценный инструмент управления питанием ноутбука.
Установка
Включение и базовая настройка
Чтобы LMT заработал:
# systemctl enable laptop-mode.service
Включение и настройка производится через главный конфигурационный файл /etc/laptop-mode/laptop-mode.conf , а так же через индивидуальные для каждого модуля конфигурационные файлы в /etc/laptop-mode/conf.d/* . В последних версиях LMT можно автоматически включать общеиспользуемые настройки модулей conf.d/* с помощью переменной ENABLE_AUTO_MODULES в /etc/laptop-mode/laptop-mode.conf .
/etc/laptop-mode/laptop-mode.conf
Настройки LMT по умолчанию предполагают, что вы не используете энергосберегающих функций при питании от сети. Учтите, что при использовании режима энергосбережения увеличивается срок службы некоторых частей компьютера (кроме, вероятно, жестких дисков). Снижается тепловыделение, замедляется кулер — увеличивается срок службы термопасты и снижается запыленность внутренностей. Кроме того с шумящим и постоянно греющимся устройством неудобно работать. Автор перевода лично имел счастье отковыривать процессор, пригревший к радиатору, за счет некорректно настроенного температурного режима в BIOS. Поэтому рекомендуется для любых типов компьютеров при питании от сети выставить гувернер процессора ondemand, а так же следить за температурой внутренних устройств. Если температура достигает 80 и более градусов, следует провести профилактику (чистка от пыли, замена термопасты). При температуре компонентов свыше 115 градусов включаются встроенные средства защиты от перегрева и компьютер может произвольно выключаться, считая, что его собственное железо важнее ваших данных.
Тонкая настройка модулей
Конфигурационные файлы, расположенные в /etc/laptop-mode/conf.d сгруппированы по управляемым ими подсистемам. На вашем ноутбуке может не быть оборудования, настраиваемого с помощью некоторых конфигурационных файлов, поэтому целесообразно отключить их. Чтобы проверить, какие устройства имеются в вашей системе, выполните: Список устройств, подключённых через шину PCI.
Список устройств, подключённых через USB порты.
Это примеры вывода для ноутбука HP Compaq 6715s. Приведённые конфигурационные файлы использовались именно на нем.
Настройки ядра
Процессор
Дополнительная информация (на английском):
Может быть он отключает счётчики неиспользуемых ядер?
Управление частотой процессора
Многоядерные процессоры
- См. SMT на Википедии (на английском).
Источник
Laptop Mode Tools
Laptop Mode Tools is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.
Combined with acpid and CPU frequency scaling, LMT provides most users with a complete notebook power management suite.
Contents
Installation
Configuration
Configuration is handled through:
- /etc/laptop-mode/laptop-mode.conf — primary configuration file.
- /etc/laptop-mode/conf.d/* — dozens of feature-specific «modules».
Each module can be explicitly enabled , disabled , or set to auto by changing the CONTROL_* argument of any file in conf.d/ . LMT will attempt enable any modules where CONTROL_* is set to auto if ENABLE_AUTO_MODULES is set in /etc/laptop-mode/laptop-mode.conf . There are two exceptions to the above rule: auto-hibernate.conf and battery-level-polling.conf use an ENABLE_* variable instead of CONTROL_* .
To quickly check which modules are enabled, disabled or auto, run:
Hard disks
For this you need to have hdparm and/or sdparm installed. See Hdparm.
Spinning down the hard drive through hdparm -S values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish hdparm -B values. The maximum hard drive power saving is 1 and the minimum is 254. For example, set this value to 254 when on AC and 20 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (e.g. 128) which will make it spin down less often. hdparm -S and hdparm -B values are configured in /etc/laptop-mode/laptop-mode.conf .
With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending commit=600,noatime in the mount options. This keeps the journaling program jbd2 from accessing your disk every few seconds, instead the disk journal gets updated every 10 minutes.
Solid state drives
Question: I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?
Answer: They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware, you will get no gain at all, for some the gain may be substantial.
CPU frequency
For this you need to have a CPU frequency driver installed. See CPU frequency scaling.
Device and bus
Intel SATA
- Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.
USB autosuspend
Display and graphics
LCD brightness
- Available brightness values for certain laptops can be obtained by running following command:
ThinkPad T40/T42
For ThinkPad T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:
ThinkPad T60
- For ThinkPad T60 notebooks, minimum and maximum brightness values can be obtained by running:
Terminal blanking
Networking
Ethernet
Wireless LAN
Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:
- /etc/laptop-mode/conf.d/wireless-power.conf for a generic method of saving power (using «iwconfig wlan0 power on/off»). This applies to most chipsets (that is, anything but Intel chipsets listed below).
- /etc/laptop-mode/conf.d/wireless-ipw-power.conf for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See /usr/share/laptop-mode-tools/modules/wireless-ipw-power for details. (note that the ipw3945 is not used anymore, see below)
- /etc/laptop-mode/conf.d/wireless-iwl-power.conf for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)
Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.
The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.
There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of /etc/laptop-mode/conf.d/wireless-iwl-power.conf :
are ignored, because the /sys/class/net/wlan*/device/power_level file does not exist. Instead, the standard method (with «iwconfig wlan0 power on/off») is automatically used.
Audio
Intel HDA
Troubleshooting
Laptop-mode-tools is not picking up events
Install acpid and enable its systemd service acpid.service .
If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to «auto», which may not enable them.
I have experienced issues with bluetooth not working if I boot up with battery, and I fixed it with disabling runtime-pm.
USB Mouse sleeping after 5 seconds when on battery
First find the ID of you device (it should look like 046d:c534 ):
Put this value into the AUTOSUSPEND_DEVID_BLACKLIST variable in /etc/laptop-mode/conf.d/runtime-pm.conf , for example:
Multiple IDs can be seperated with spaces.
Issues with NVIDIA driver
KDE shows black screen
When laptop mode is enabled, KDE fails to start. The reason is that the default KDE display manager (SDDM) starts before the NVIDIA driver. To prevent this from happening you need to remove the nomodeset kernel parameter.
Источник
Laptop Mode Tools
Laptop Mode Tools is a laptop power saving package for Linux systems. It is the primary way to enable the Laptop Mode feature of the Linux kernel, which lets your hard drive spin down. In addition, it allows you to tweak a number of other power-related settings using a simple configuration file.
Combined with acpid and CPU frequency scaling, LMT provides most users with a complete notebook power management suite.
Contents
Installation
Configuration
Configuration is handled through:
- /etc/laptop-mode/laptop-mode.conf — primary configuration file.
- /etc/laptop-mode/conf.d/* — dozens of feature-specific «modules».
Each module can be explicitly enabled , disabled , or set to auto by changing the CONTROL_* argument of any file in conf.d/ . LMT will attempt enable any modules where CONTROL_* is set to auto if ENABLE_AUTO_MODULES is set in /etc/laptop-mode/laptop-mode.conf . There are two exceptions to the above rule: auto-hibernate.conf and battery-level-polling.conf use an ENABLE_* variable instead of CONTROL_* .
To quickly check which modules are enabled, disabled or auto, run:
Hard disks
For this you need to have hdparm and/or sdparm installed. See Hdparm.
Spinning down the hard drive through hdparm -S values saves power and makes everything a lot more quiet. By using the readahead function you can allow the drives to spin down more often even though you are using the computer. LMT can also establish hdparm -B values. The maximum hard drive power saving is 1 and the minimum is 254. For example, set this value to 254 when on AC and 20 when on battery. If you find that normal activity hangs often while waiting for the disk to spin up, it might be a good idea to set it to a higher value (e.g. 128) which will make it spin down less often. hdparm -S and hdparm -B values are configured in /etc/laptop-mode/laptop-mode.conf .
With the CONTROL_MOUNT_OPTIONS variable (default on), laptop-mode-tools automatically remounts your partitions, appending commit=600,noatime in the mount options. This keeps the journaling program jbd2 from accessing your disk every few seconds, instead the disk journal gets updated every 10 minutes.
Solid state drives
Question: I have a solid-state disk (SSD) in my machine. Should I enable any of the disk-related parts of laptop-mode-tools, or are they irrelevant?
Answer: They may be relevant, because (a) laptop mode will reduce the number of writes, which improves the lifetime of an SSD, and (b) laptop mode makes writes bursty, which enables power saving mechanisms like ALPM to kick in. However, your mileage may vary depending on the specific hardware involved. For some hardware, you will get no gain at all, for some the gain may be substantial.
CPU frequency
For this you need to have a CPU frequency driver installed. See CPU frequency scaling.
Device and bus
Intel SATA
- Enable the Intel SATA AHCI controller Aggressive Link Power Management feature to set the disk link into a very low power mode in the absence of disk IO.
USB autosuspend
Display and graphics
LCD brightness
- Available brightness values for certain laptops can be obtained by running following command:
ThinkPad T40/T42
For ThinkPad T40/T42 notebooks, minimum and maximum brightness values can be obtained by running:
ThinkPad T60
- For ThinkPad T60 notebooks, minimum and maximum brightness values can be obtained by running:
Terminal blanking
Networking
Ethernet
Wireless LAN
Wireless interface power management settings are hardware-dependent, and thus a bit trickier to configure. Depending on the wireless chipset, the settings are managed in one of the following three files:
- /etc/laptop-mode/conf.d/wireless-power.conf for a generic method of saving power (using «iwconfig wlan0 power on/off»). This applies to most chipsets (that is, anything but Intel chipsets listed below).
- /etc/laptop-mode/conf.d/wireless-ipw-power.conf for Intel chipsets driven by the old ipw driver. This apply to IPW3945, IPW2200 and IPW2100. It currently (as of LMT 1.55-1) uses iwpriv for IPW3945, and a combination of iwconfig and iwpriv settings for IPW2100 and IPW220. See /usr/share/laptop-mode-tools/modules/wireless-ipw-power for details. (note that the ipw3945 is not used anymore, see below)
- /etc/laptop-mode/conf.d/wireless-iwl-power.conf for Intel chipsets driven by modules iwl4965, iwl3945 and iwlagn (this latter supports chipsets 4965, 5100, 5300, 5350, 5150, 1000, and 6000)
Note that activating the three of them should not be much of a problem, since LMT detects the module used by the interface and acts accordingly.
The supported modules for each configuration file, indicated above, are taken directly from LMT. However, this seems to be a bit out-of-date, since the current 2.6.34 kernel does not provide the ipw3945 and iwl4965 modules anymore (3945 chipset uses iwl3945 instead, and 4965 uses the generic module iwlagn). This is only brought here for information, as this does not (or should not) affect the way LMT works.
There is a known issue with some chipsets running with the iwlagn module (namely, the 5300 chipset, and maybe others). On those chipsets, the following settings of /etc/laptop-mode/conf.d/wireless-iwl-power.conf :
are ignored, because the /sys/class/net/wlan*/device/power_level file does not exist. Instead, the standard method (with «iwconfig wlan0 power on/off») is automatically used.
Audio
Intel HDA
Troubleshooting
Laptop-mode-tools is not picking up events
Install acpid and enable its systemd service acpid.service .
If that does not help, go through the laptop-mode configuration files and make sure that the service you want to enable is set to 1. Many services (including cpufreq control) are by default set to «auto», which may not enable them.
I have experienced issues with bluetooth not working if I boot up with battery, and I fixed it with disabling runtime-pm.
USB Mouse sleeping after 5 seconds when on battery
First find the ID of you device (it should look like 046d:c534 ):
Put this value into the AUTOSUSPEND_DEVID_BLACKLIST variable in /etc/laptop-mode/conf.d/runtime-pm.conf , for example:
Multiple IDs can be seperated with spaces.
Issues with NVIDIA driver
KDE shows black screen
When laptop mode is enabled, KDE fails to start. The reason is that the default KDE display manager (SDDM) starts before the NVIDIA driver. To prevent this from happening you need to remove the nomodeset kernel parameter.
Источник