* RIL-267 Adding cpu governor and kernel module opts * RIL-267 Adding cpu governor and kernel module opts * RIL-267 Adding cpu governor and kernel module optspull/102/head
- tp_smapi | - tp_smapi | ||||
- 8021q | - 8021q | ||||
Configure or blacklist kernel modules with additional options to `/etc/modprobe.d` following example | |||||
will add `/etc/modprobe.d/nf_conntrack.conf` file with line `options nf_conntrack hashsize=262144`: | |||||
.. code-block:: yaml | |||||
linux: | |||||
system: | |||||
kernel: | |||||
module: | |||||
nf_conntrack: | |||||
option: | |||||
hashsize: 262144 | |||||
Install specific kernel version and ensure all other kernel packages are | Install specific kernel version and ensure all other kernel packages are | ||||
not present. Also install extra modules and headers for this kernel: | not present. Also install extra modules and headers for this kernel: | ||||
CPU | CPU | ||||
~~~ | ~~~ | ||||
Disable ondemand cpu mode service: | |||||
Enable cpufreq governor for every cpu: | |||||
.. code-block:: yaml | .. code-block:: yaml | ||||
{% for cpu_core in range(salt['grains.get']('num_cpus', 1)) %} | |||||
devices/system/cpu/cpu{{ cpu_core }}/cpufreq/scaling_governor = {{ governor }} | |||||
{% endfor %} |
{% if module_content.get('blacklist', false) -%} | |||||
blacklist {{ module_name }} | |||||
{%- else -%} | |||||
{%- for option, value in module_content.get('option', {}) | dictsort -%} | |||||
options {{ module_name }} {{ option }}={{ value }} | |||||
{%- endfor %} | |||||
{%- endif %} |
{%- 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 | |||||
ondemand_service_disable: | ondemand_service_disable: | ||||
service.dead: | service.dead: | ||||
- name: ondemand | |||||
- enable: false | |||||
- name: ondemand | |||||
- enable: false | |||||
/etc/sysfs.d/governor.conf: | |||||
file.managed: | |||||
- source: salt://linux/files/governor.conf.jinja | |||||
- template: jinja | |||||
- user: root | |||||
- group: root | |||||
- mode: 0644 | |||||
- defaults: | |||||
governor: {{ system.cpu.governor }} | |||||
{% for cpu_core in range(salt['grains.get']('num_cpus', 1)) %} | |||||
governor_write_sysfs_cpu_core_{{ cpu_core }}: | |||||
module.run: | |||||
- name: sysfs.write | |||||
- key: devices/system/cpu/cpu{{ cpu_core }}/cpufreq/scaling_governor | |||||
- value: {{ system.cpu.governor }} | |||||
{%- endfor %} | |||||
{%- endif %} | |||||
{%- endif %} |
{%- endfor %} | {%- endfor %} | ||||
{%- for module_name, module_content in system.kernel.get('module', {}).iteritems() %} | |||||
/etc/modprobe.d/{{ module_name }}.conf: | |||||
file.managed: | |||||
- user: root | |||||
- group: root | |||||
- mode: 0644 | |||||
- template: jinja | |||||
- source: salt://linux/files/modprobe.conf.jinja | |||||
- defaults: | |||||
module_content: {{ module_content }} | |||||
module_name: {{ module_name }} | |||||
{%- endfor %} | |||||
{%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %} | {%- for sysctl_name, sysctl_value in system.kernel.get('sysctl', {}).iteritems() %} | ||||
linux_kernel_{{ sysctl_name }}: | linux_kernel_{{ sysctl_name }}: |