Add cpu_set_perf_perc on Linux.
This commit is contained in:
parent
347ffaea12
commit
f1da60377e
15
ansible/roles/cpu/files/cpu_set_perf_perc_linux
Normal file
15
ansible/roles/cpu/files/cpu_set_perf_perc_linux
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
#
|
||||||
|
# Tell speedshift whether to maximize CPU performance (100) or energy
|
||||||
|
# efficiency (0).
|
||||||
|
set -euo pipefail
|
||||||
|
IFS=$'\n\t'
|
||||||
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||||
|
|
||||||
|
perc=$1
|
||||||
|
|
||||||
|
if [ $perc -lt 50 ]; then
|
||||||
|
echo "power" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
|
||||||
|
else
|
||||||
|
echo "performance" | tee /sys/devices/system/cpu/cpufreq/policy*/energy_performance_preference
|
||||||
|
fi
|
@ -65,7 +65,7 @@
|
|||||||
owner: root
|
owner: root
|
||||||
group: wheel
|
group: wheel
|
||||||
loop:
|
loop:
|
||||||
- src: cpu_set_perf_perc
|
- src: cpu_set_perf_perc_freebsd
|
||||||
dest: /usr/local/bin/cpu_set_perf_perc
|
dest: /usr/local/bin/cpu_set_perf_perc
|
||||||
|
|
||||||
- name: Install loader.conf
|
- name: Install loader.conf
|
||||||
|
@ -25,3 +25,15 @@
|
|||||||
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 scripts
|
||||||
|
when: hwpstate is defined and hwpstate
|
||||||
|
copy:
|
||||||
|
src: "files/{{ item.src }}"
|
||||||
|
dest: "{{ item.dest }}"
|
||||||
|
mode: 0755
|
||||||
|
owner: root
|
||||||
|
group: wheel
|
||||||
|
loop:
|
||||||
|
- src: cpu_set_perf_perc_linux
|
||||||
|
dest: /usr/local/bin/cpu_set_perf_perc
|
||||||
|
Loading…
Reference in New Issue
Block a user