Skip to content

Commit

Permalink
Merge pull request #645 from vcandapp/tuned_power
Browse files Browse the repository at this point in the history
Add edpm variable for powersave profile
  • Loading branch information
openshift-merge-bot[bot] authored Apr 30, 2024
2 parents 85586df + a090572 commit 470a305
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions roles/edpm_tuned/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ edpm_tuned_download_retries: 5
edpm_tuned_profile: "throughput-performance"
edpm_tuned_custom_profile: ""
edpm_tuned_isolated_cores: ""
edpm_tuned_max_power_cstate: ""

# Default tuned packages to install
edpm_tuned_system_packages_default:
Expand Down
6 changes: 6 additions & 0 deletions roles/edpm_tuned/meta/argument_specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ argument_specs:
for example: 2,4-7 .
Please note that the value may be rendered in a different .conf
file, depending on your local setup.
edpm_tuned_max_power_cstate:
type: str
default: ""
description: >
String which specifies maximum powerstate for idling cores
for example, C6|140.
edpm_tuned_system_packages_default:
type: list
description: >
Expand Down
13 changes: 13 additions & 0 deletions roles/edpm_tuned/tasks/configure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,19 @@
- (edpm_tuned_isolated_cores | length) > 0
- (edpm_tuned_conf_stat_result.stat.exists | bool)

- name: "Configure c-state if profile is powersave: {{ edpm_tuned_profile }}"
ansible.builtin.lineinfile:
dest: "/etc/tuned/{{ edpm_tuned_profile }}-variables.conf"
mode: '0644'
regexp: '^max_power_state=cstate.name.*'
line: 'max_power_state=cstate.name:{{ edpm_tuned_max_power_cstate }}'
become: true
when:
- edpm_tuned_max_power_cstate is defined
- (edpm_tuned_max_power_cstate | length) > 0
- (edpm_tuned_conf_stat_result.stat.exists | bool)
- (edpm_tuned_profile == 'cpu-partitioning-powersave')

- name: Enable tuned profile
ansible.builtin.command: >-
/usr/sbin/tuned-adm profile {{ edpm_tuned_profile }}
Expand Down

0 comments on commit 470a305

Please sign in to comment.