Skip to content

Commit 470a305

Browse files
Merge pull request openstack-k8s-operators#645 from vcandapp/tuned_power
Add edpm variable for powersave profile
2 parents 85586df + a090572 commit 470a305

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

roles/edpm_tuned/defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ edpm_tuned_download_retries: 5
2626
edpm_tuned_profile: "throughput-performance"
2727
edpm_tuned_custom_profile: ""
2828
edpm_tuned_isolated_cores: ""
29+
edpm_tuned_max_power_cstate: ""
2930

3031
# Default tuned packages to install
3132
edpm_tuned_system_packages_default:

roles/edpm_tuned/meta/argument_specs.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ argument_specs:
3333
for example: 2,4-7 .
3434
Please note that the value may be rendered in a different .conf
3535
file, depending on your local setup.
36+
edpm_tuned_max_power_cstate:
37+
type: str
38+
default: ""
39+
description: >
40+
String which specifies maximum powerstate for idling cores
41+
for example, C6|140.
3642
edpm_tuned_system_packages_default:
3743
type: list
3844
description: >

roles/edpm_tuned/tasks/configure.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@
6666
- (edpm_tuned_isolated_cores | length) > 0
6767
- (edpm_tuned_conf_stat_result.stat.exists | bool)
6868

69+
- name: "Configure c-state if profile is powersave: {{ edpm_tuned_profile }}"
70+
ansible.builtin.lineinfile:
71+
dest: "/etc/tuned/{{ edpm_tuned_profile }}-variables.conf"
72+
mode: '0644'
73+
regexp: '^max_power_state=cstate.name.*'
74+
line: 'max_power_state=cstate.name:{{ edpm_tuned_max_power_cstate }}'
75+
become: true
76+
when:
77+
- edpm_tuned_max_power_cstate is defined
78+
- (edpm_tuned_max_power_cstate | length) > 0
79+
- (edpm_tuned_conf_stat_result.stat.exists | bool)
80+
- (edpm_tuned_profile == 'cpu-partitioning-powersave')
81+
6982
- name: Enable tuned profile
7083
ansible.builtin.command: >-
7184
/usr/sbin/tuned-adm profile {{ edpm_tuned_profile }}

0 commit comments

Comments
 (0)