Change-Id: I29cfe2cd9dd39b74a1d39313f78dfddc87cb79b8pull/122/head
cpu: | cpu: | ||||
governor: performance | governor: performance | ||||
Sysfs | |||||
~~~~~ | |||||
Install sysfsutils and set sysfs attributes: | |||||
.. code-block:: yaml | |||||
linux: | |||||
system: | |||||
sysfs: | |||||
scheduler: | |||||
block/sda/queue/scheduler: deadline | |||||
power: | |||||
mode: | |||||
power/state: 0660 | |||||
owner: | |||||
power/state: "root:power" | |||||
devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave | |||||
Huge Pages | Huge Pages | ||||
~~~~~~~~~~~~ | ~~~~~~~~~~~~ | ||||
# Sysfs file for {{ name }} managed by salt-minion(1) | |||||
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN | |||||
{%- for key, value in sysfs.iteritems() %} | |||||
{%- if key in ["mode", "owner"] %} | |||||
{%- for attr, val in value.iteritems() %} | |||||
mode {{ attr }} = {{ val }} | |||||
{%- endfor %} | |||||
{%- else %} | |||||
{{ key }} = {{ value }} | |||||
{%- endif %} | |||||
{%- endfor %} | |||||
{#- | |||||
vim: syntax=jinja | |||||
-#} |
{%- from "linux/map.jinja" import system with context %} | {%- from "linux/map.jinja" import system with context %} | ||||
{%- if system.cpu.governor is defined %} | {%- if system.cpu.governor is defined %} | ||||
linux_sysfs_package: | |||||
pkg.installed: | |||||
- pkgs: | |||||
- sysfsutils | |||||
- refresh: true | |||||
/etc/sysfs.d: | |||||
file.directory: | |||||
- require: | |||||
- pkg: linux_sysfs_package | |||||
include: | |||||
- linux.system.sysfs | |||||
ondemand_service_disable: | ondemand_service_disable: | ||||
service.dead: | service.dead: |
{%- if system.cpu is defined %} | {%- if system.cpu is defined %} | ||||
- linux.system.cpu | - linux.system.cpu | ||||
{%- endif %} | {%- endif %} | ||||
{%- if system.sysfs is defined %} | |||||
- linux.system.sysfs | |||||
{%- endif %} | |||||
{%- if system.locale|length > 0 %} | {%- if system.locale|length > 0 %} | ||||
- linux.system.locale | - linux.system.locale | ||||
{%- endif %} | {%- endif %} |
{%- from "linux/map.jinja" import system with context %} | |||||
linux_sysfs_package: | |||||
pkg.installed: | |||||
- pkgs: | |||||
- sysfsutils | |||||
- refresh: true | |||||
/etc/sysfs.d: | |||||
file.directory: | |||||
- require: | |||||
- pkg: linux_sysfs_package | |||||
{%- for name, sysfs in system.get('sysfs', {}).iteritems() %} | |||||
/etc/sysfs.d/{{ name }}.conf: | |||||
file.managed: | |||||
- source: salt://linux/files/sysfs.conf | |||||
- template: jinja | |||||
- user: root | |||||
- group: root | |||||
- mode: 0644 | |||||
- defaults: | |||||
name: {{ name }} | |||||
sysfs: {{ sysfs|yaml }} | |||||
- require: | |||||
- file: /etc/sysfs.d | |||||
{%- for key, value in sysfs.iteritems() %} | |||||
{%- if key not in ["mode", "owner"] %} | |||||
{%- if grains.get('virtual_subtype', None) not in ['Docker', 'LXC'] %} | |||||
{#- Sysfs cannot be set in docker, LXC, etc. #} | |||||
linux_sysfs_write_{{ name }}_{{ key }}: | |||||
module.run: | |||||
- name: sysfs.write | |||||
- key: {{ key }} | |||||
- value: {{ value }} | |||||
{%- endif %} | |||||
{%- endif %} | |||||
{%- endfor %} | |||||
{%- endfor %} |
default: "linux.ci.local$" | default: "linux.ci.local$" | ||||
kernel: | kernel: | ||||
isolcpu: 1,2,3,4 | isolcpu: 1,2,3,4 | ||||
sysfs: | |||||
scheduler: | |||||
block/sda/queue/scheduler: deadline | |||||
power: | |||||
mode: | |||||
power/state: 0660 | |||||
owner: | |||||
power/state: "root:power" | |||||
devices/system/cpu/cpu0/cpufreq/scaling_governor: powersave | |||||
motd: | motd: | ||||
- warning: | | - warning: | | ||||
#!/bin/sh | #!/bin/sh |