{{expansion|reason=The device should likely be disabled with hciconfig first.}}

{{expansion|reason=The device should likely be disabled with hciconfig first.}}

+

[[Kernel_modules#Blacklisting|Blacklist]] the {{ic|hci_usb}} module if the driver is loaded automatically.

[[Kernel_modules#Blacklisting|Blacklist]] the {{ic|hci_usb}} module if the driver is loaded automatically.

Line 74:

Line 76:

=== Kernel parameters ===

=== Kernel parameters ===

−

This section uses configs in {{ic|/etc/sysctl.d/}}, which is ''"a drop-in directory for kernel sysctl parameters, extending what you can already do with /etc/sysctl.conf."'' See [http://0pointer.de/blog/projects/the-new-configuration-files The New Configuration Files] and more specifically [http://0pointer.de/public/systemd-man/sysctl.d.html systemd's sysctl.d man page] for more information.

+

This section uses configs in {{ic|/etc/sysctl.d/}}, which is ''"a drop-in directory for kernel sysctl parameters."'' See [http://0pointer.de/blog/projects/the-new-configuration-files The New Configuration Files] and more specifically [http://0pointer.de/public/systemd-man/sysctl.d.html systemd's sysctl.d man page] for more information.

==== Disabling NMI watchdog ====

==== Disabling NMI watchdog ====

Line 85:

Line 87:

==== Writeback Time ====

==== Writeback Time ====

+

Increasing the VM dirty writeback time can help to aggregate I/O together - reducing disk writes, and decreasing power usage:

Increasing the VM dirty writeback time can help to aggregate I/O together - reducing disk writes, and decreasing power usage:

−

vm.dirty_writeback_centisecs = 1500

+

{{hc|/etc/sysctl.d/dirty.conf|2=vm.dirty_writeback_centisecs = 1500}}

To do the same for journal commits with ext4 and some other filesystems, use {{ic|1=commit=15}} as a parameter in [[fstab]] or with the {{ic|rootflags}} [[kernel parameter]].

To do the same for journal commits with ext4 and some other filesystems, use {{ic|1=commit=15}} as a parameter in [[fstab]] or with the {{ic|rootflags}} [[kernel parameter]].

Line 95:

Line 98:

See the [https://www.kernel.org/doc/Documentation/laptops/laptop-mode.txt kernel documentation] on the laptop mode 'knob.' ''"A sensible value for the knob is 5 seconds."''

See the [https://www.kernel.org/doc/Documentation/laptops/laptop-mode.txt kernel documentation] on the laptop mode 'knob.' ''"A sensible value for the knob is 5 seconds."''

−

vm.laptop_mode = 5

+

{{hc|/etc/sysctl.d/laptop.conf|2=vm.laptop_mode = 5}}

=== Network interfaces ===

=== Network interfaces ===

Line 101:

Line 104:

[[Wikipedia:Wake-on-LAN|Wake-on-LAN]] can be a useful feature, but if you're not making use of it then it's simply draining extra power waiting for a magic packet while in suspend. Disabling for all Ethernet interfaces:

[[Wikipedia:Wake-on-LAN|Wake-on-LAN]] can be a useful feature, but if you're not making use of it then it's simply draining extra power waiting for a magic packet while in suspend. Disabling for all Ethernet interfaces:

In these examples, {{ic|%k}} is a specifier for the kernel name of the matched device. For example, if it finds that the rule is applicable to {{ic|wlan0}}, the {{ic|%k}} specifier will be replaced with {{ic|wlan0}}. To apply the rules to only a particular interface, just replace the pattern {{ic|eth*}} and specifier {{ic|%k}} with the desired interface name. For more information, see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].

In these examples, {{ic|%k}} is a specifier for the kernel name of the matched device. For example, if it finds that the rule is applicable to {{ic|wlan0}}, the {{ic|%k}} specifier will be replaced with {{ic|wlan0}}. To apply the rules to only a particular interface, just replace the pattern {{ic|eth*}} and specifier {{ic|%k}} with the desired interface name. For more information, see [http://www.reactivated.net/writing_udev_rules.html Writing udev rules].

Line 118:

Line 121:

{{Note|This adds latency when accessing a drive that has been idle, so it's one of the few settings that may be worth toggling based on whether you're on AC power.}}

{{Note|This adds latency when accessing a drive that has been idle, so it's one of the few settings that may be worth toggling based on whether you're on AC power.}}

You might want to use the {{ic|noatime}} option, see [[Fstab#atime options]] for more information.

+

+

=== CD/DVD spin down ===

+

+

{{Expansion|something similar without using udisks?}}

+

+

To allow the CD/DVD rom to spin down after a while using [[udisks]]:

+

+

# udisks --inhibit-polling /dev/sr0

== Tools and scripts ==

== Tools and scripts ==

Line 146:

Line 164:

There are many scripts and tools which make use of the various settings described in the previous sections. These are notably:

There are many scripts and tools which make use of the various settings described in the previous sections. These are notably:

+

* [[Powertop]] is a handy utility from Intel that displays which hardware/processes are using the most power on your system, and provides instructions on how to stop or remove power-wasting services. It's report functionality can also be used to identify the relevant parameters for the system.

* [[TLP]]

* [[TLP]]

* [[Powerdown]]

* [[Powerdown]]

Line 159:

Line 178:

=== Using a script and an udev rule ===

=== Using a script and an udev rule ===

−

Since systemd users can suspend and hibernate through {{ic|systemctl suspend}} or {{ic|systemctl hibernate}} and handle acpi events with {{ic|/etc/systemd/logind.conf}}, it might be interesting to remove pm-utils and acpid. Now, there's just one thing systemd can't do (at this time of writing): powermanagement, depending on whether the system is running on AC or battery. To fill this gap, one can create a single udev rule that launches a script when the laptop is unplugged and plugged:

+

Since systemd users can suspend and hibernate through {{ic|systemctl suspend}} or {{ic|systemctl hibernate}} and handle acpi events with {{ic|/etc/systemd/logind.conf}}, it might be interesting to remove [[pm-utils]] and [[acpid]]. There's just one thing systemd can't do (as of systemd-204): power management depending on whether the system is running on AC or battery. To fill this gap, you can create a single [[udev]] rule that runs a script when the AC adapter is plugged and unplugged:

{{Note|One can use the same script that pm-powersave uses. You just have to make it executable and place it somewhere else (for example, /usr/bin).}}

+

−

Examples of powersave scripts can be found here: [https://bbs.archlinux.org/viewtopic.php?pid=1046075#p1046075] (or in aur: {{AUR|powerdown}}), here: [https://github.com/Unia/powersave] and there: {{AUR|powerconf}}.

+

{{Note|You can use the same script that ''pm-powersave'' uses. You just have to make it executable and place it somewhere else (for example {{ic|/usr/local/bin/}}).}}

+

+

Examples of powersave scripts can be found here: {{AUR|powerdown}}, {{AUR|powerconf}}, [https://github.com/Unia/powersave powersave].

The above udev rule should work as expected, but if your power settings aren't updated after a suspend or hibernate cycle, you should add a script in {{ic|/usr/lib/systemd/system-sleep/}} with the following contents:

The above udev rule should work as expected, but if your power settings aren't updated after a suspend or hibernate cycle, you should add a script in {{ic|/usr/lib/systemd/system-sleep/}} with the following contents:

+

{{hc|/usr/lib/systemd/system-sleep/00powersave|<nowiki>

{{hc|/usr/lib/systemd/system-sleep/00powersave|<nowiki>

#!/bin/sh

#!/bin/sh

Line 181:

Line 204:

fi

fi

;;

;;

−

esac'

+

esac

exit 0

exit 0

</nowiki>}}

</nowiki>}}

Don't forget to make it executable!

Don't forget to make it executable!

+

{{Note|Be aware that AC0 may be different for your laptop, change it if that is the case.}}

{{Note|Be aware that AC0 may be different for your laptop, change it if that is the case.}}

Line 194:

Line 218:

This script prints power settings and a variety of other properties for USB and PCI devices. Note that root permissions are needed to see all settings.

This script prints power settings and a variety of other properties for USB and PCI devices. Note that root permissions are needed to see all settings.

Configuration

If you would like to create your own scripts and power saving settings such as by udev rules you can take the following settings as a reference.

Audio

By default, audio power saving is turned off by most drivers. It can be enabled by setting the power_save parameter; a time (in seconds) to go into idle mode. To idle the audio card after one second, create

/etc/modprobe.d/audio_powersave.conf

options snd_hda_intel power_save=1

for Intel, or use

options snd_ac97_codec power_save=1

for ac97.

Note: Toggling the audio card's power state can cause a popping sound or noticeable latency on some broken hardware.

In these examples, %k is a specifier for the kernel name of the matched device. For example, if it finds that the rule is applicable to wlan0, the %k specifier will be replaced with wlan0. To apply the rules to only a particular interface, just replace the pattern eth* and specifier %k with the desired interface name. For more information, see Writing udev rules.

In this case, the name of the configuration file is important. Due to the introduction of persistent device names via 80-net-name-slot.rules in systemd v197, it is important that the network powersave rules are named lexicographically before 80-net-name-slot.rules, so that they are applied before the devices are named e.g. enp2s0.

PCI Runtime Power Management

/etc/udev/rules.d/pci_pm.rules

ACTION=="add", SUBSYSTEM=="pci", ATTR{power/control}="auto"

SATA Active Link Power Management

Note: This adds latency when accessing a drive that has been idle, so it's one of the few settings that may be worth toggling based on whether you're on AC power.

Tools and scripts

Packages

There are many scripts and tools which make use of the various settings described in the previous sections. These are notably:

Powertop is a handy utility from Intel that displays which hardware/processes are using the most power on your system, and provides instructions on how to stop or remove power-wasting services. It's report functionality can also be used to identify the relevant parameters for the system.

If you do not want to take care of the settings by yourself it is recommended to use these tools. But be aware of running only one of these tools to avoid possible conflicts as they all work more or less similar.

Using a script and an udev rule

Since systemd users can suspend and hibernate through systemctl suspend or systemctl hibernate and handle acpi events with /etc/systemd/logind.conf, it might be interesting to remove pm-utils and acpid. There's just one thing systemd can't do (as of systemd-204): power management depending on whether the system is running on AC or battery. To fill this gap, you can create a single udev rule that runs a script when the AC adapter is plugged and unplugged:

The above udev rule should work as expected, but if your power settings aren't updated after a suspend or hibernate cycle, you should add a script in /usr/lib/systemd/system-sleep/ with the following contents: