Change the power role to just setting the energy performance preference (epp).

This commit is contained in:
Tom Alexander 2023-03-23 16:09:37 -04:00
parent dd8c2ff937
commit 977e382726
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE
5 changed files with 26 additions and 54 deletions

View File

@ -26,3 +26,5 @@ build_user:
wireguard_directory: odo wireguard_directory: odo
enabled_wireguard: enabled_wireguard:
- wgh - wgh
hwpstate: true
cores: 8

View File

@ -1,15 +0,0 @@
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

@ -0,0 +1,2 @@
# Disable turboboost. This makes the laptop significantly quieter and probably helps battery life.
w- /sys/devices/system/cpu/intel_pstate/no_turbo - - - - 1

View File

@ -2,47 +2,26 @@
package: package:
name: name:
- powertop - powertop
- tlp
state: present state: present
# - name: Configure TLP - name: Install tmpfiles.d configuration
# lineinfile: copy:
# path: /etc/tlp.conf src: "files/{{ item }}_tmpfiles.conf"
# regexp: "^{{ item.key }}=" dest: "/etc/tmpfiles.d/{{ item }}.conf"
# line: '{{ item.key }}="{{ item.value }}"' mode: 0644
# loop: "{{ tlp_config | dict2items }}" owner: root
# when: '" " in item.value' group: wheel
# - 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: loop:
- name: vm.dirty_writeback_centisecs - disable_turboboost
value: 2000 # Default is 500 (5 seconds)
- name: Configure sysctls - name: Favor energy efficiency for Speed Shift
sysctl: when: hwpstate is defined and hwpstate and cores is defined
name: "{{ item.name }}" template:
value: "{{ item.value }}" src: "templates/{{ item.src }}.j2"
state: present dest: "{{ item.dest }}"
sysctl_file: /etc/sysctl.d/laptop.conf mode: 0755
owner: root
group: wheel
loop: loop:
- name: vm.laptop_mode - src: energy_performance_preference.conf
value: 5 dest: /etc/tmpfiles.d/energy_performance_preference.conf
- name: Enable services
systemd:
name: tlp.service
daemon_reload: yes
enabled: true

View File

@ -0,0 +1,4 @@
# Favor energy efficiency for Speed Shift
{% for core in range(0, cores, 1) %}
w- /sys/devices/system/cpu/cpufreq/policy{{core}}/energy_performance_preference - - - - power
{% endfor %}