Also set the platform profile for AMD.
The platform profile sets power settings for the EC/system but not the CPU.
This commit is contained in:
parent
c87ac216a9
commit
9ac2605912
@ -8,6 +8,14 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|||||||
|
|
||||||
perc=$1
|
perc=$1
|
||||||
|
|
||||||
|
if [ "$perc" -gt 80 ]; then
|
||||||
|
echo performance | tee /sys/firmware/acpi/platform_profile
|
||||||
|
elif [ "$perc" -ge 20 ]; then
|
||||||
|
echo balanced | tee /sys/firmware/acpi/platform_profile
|
||||||
|
else
|
||||||
|
echo low-power | tee /sys/firmware/acpi/platform_profile
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$perc" -ge 80 ]; then
|
if [ "$perc" -ge 80 ]; then
|
||||||
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
|
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
|
||||||
elif [ "$perc" -ge 60 ]; then
|
elif [ "$perc" -ge 60 ]; then
|
||||||
|
2
ansible/roles/cpu/files/platform_profile_tmpfiles.conf
Normal file
2
ansible/roles/cpu/files/platform_profile_tmpfiles.conf
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
# Favor energy efficiency for platform profile (EC / system, not CPU)
|
||||||
|
w- /sys/firmware/acpi/platform_profile - - - - low-power
|
@ -4,18 +4,29 @@
|
|||||||
- powertop
|
- powertop
|
||||||
state: present
|
state: present
|
||||||
|
|
||||||
- name: Favor energy efficiency for Speed Shift
|
- name: Favor energy efficiency for hardware p-states
|
||||||
when: hwpstate is defined and hwpstate and cores is defined
|
when: hwpstate is defined and hwpstate and cores is defined
|
||||||
template:
|
template:
|
||||||
src: "templates/{{ item.src }}.j2"
|
src: "templates/{{ item.src }}.j2"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: 0755
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- src: energy_performance_preference.conf
|
- src: energy_performance_preference.conf
|
||||||
dest: /etc/tmpfiles.d/energy_performance_preference.conf
|
dest: /etc/tmpfiles.d/energy_performance_preference.conf
|
||||||
|
|
||||||
|
- name: Install tmpfiles.d configuration
|
||||||
|
when: hwpstate is defined and hwpstate and cores is defined
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item }}_tmpfiles.conf"
|
||||||
|
dest: "/etc/tmpfiles.d/{{ item }}.conf"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- platform_profile
|
||||||
|
|
||||||
- name: Install scripts
|
- name: Install scripts
|
||||||
when: hwpstate is defined and hwpstate
|
when: hwpstate is defined and hwpstate
|
||||||
copy:
|
copy:
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
template:
|
template:
|
||||||
src: "templates/{{ item.src }}.j2"
|
src: "templates/{{ item.src }}.j2"
|
||||||
dest: "{{ item.dest }}"
|
dest: "{{ item.dest }}"
|
||||||
mode: 0755
|
mode: 0644
|
||||||
owner: root
|
owner: root
|
||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user