Configure vm.laptop_mode and vm.dirty_writeback_centisecs.

This commit is contained in:
Tom Alexander 2023-02-18 11:30:46 -05:00
parent 0340d2fd51
commit dd8c2ff937
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
3 changed files with 55 additions and 0 deletions

View File

@ -23,3 +23,6 @@ graphics_driver: "intel"
build_user:
name: talexander
group: talexander
wireguard_directory: odo
enabled_wireguard:
- wgh

View File

@ -0,0 +1,15 @@
tlp_config:
PCIE_ASPM_ON_BAT: powersupersave
USB_ALLOWLIST: "1050:0406"
CPU_BOOST_ON_AC: "0"
CPU_BOOST_ON_BAT: "0"
CPU_ENERGY_PERF_POLICY_ON_BAT: "power"
DISK_IDLE_SECS_ON_BAT: "5"
CPU_MIN_PERF_ON_AC: "0"
CPU_MAX_PERF_ON_AC: "100"
CPU_MIN_PERF_ON_BAT: "0"
CPU_MAX_PERF_ON_BAT: "100"
# WIFI_PWR_ON_AC: "on"
# WIFI_PWR_ON_BAT: "on"
# CPU_HWP_DYN_BOOST_ON_AC: "0"
# CPU_HWP_DYN_BOOST_ON_BAT: "0"

View File

@ -2,8 +2,45 @@
package:
name:
- powertop
- tlp
state: present
# - name: Configure TLP
# lineinfile:
# path: /etc/tlp.conf
# regexp: "^{{ item.key }}="
# line: '{{ item.key }}="{{ item.value }}"'
# loop: "{{ tlp_config | dict2items }}"
# when: '" " in item.value'
# - name: Configure TLP
# lineinfile:
# path: /etc/tlp.conf
# regexp: "^{{ item.key }}="
# line: "{{ item.key }}={{ item.value }}"
# loop: "{{ tlp_config | dict2items }}"
# when: '" " not in item.value'
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/dirty.conf
loop:
- name: vm.dirty_writeback_centisecs
value: 2000 # Default is 500 (5 seconds)
- name: Configure sysctls
sysctl:
name: "{{ item.name }}"
value: "{{ item.value }}"
state: present
sysctl_file: /etc/sysctl.d/laptop.conf
loop:
- name: vm.laptop_mode
value: 5
- name: Enable services
systemd:
name: tlp.service