|
|
|
|
|
|
|
|
|
|
|
|
|
|
{%- for hugepages_type, hugepages in system.kernel.hugepages.items() %} |
|
|
{%- for hugepages_type, hugepages in system.kernel.hugepages.items() %} |
|
|
|
|
|
|
|
|
{%- if hugepages.get('mount', False) or hugepages.get('default', False) %} |
|
|
|
|
|
|
|
|
|
|
|
hugepages_mount_{{ hugepages_type }}: |
|
|
hugepages_mount_{{ hugepages_type }}: |
|
|
mount.mounted: |
|
|
mount.mounted: |
|
|
- name: {{ hugepages.mount_point }} |
|
|
- name: {{ hugepages.mount_point }} |
|
|
- device: Hugetlbfs-kvm |
|
|
|
|
|
|
|
|
- device: Hugetlbfs-kvm-{{ hugepages.size|lower }} |
|
|
- fstype: hugetlbfs |
|
|
- fstype: hugetlbfs |
|
|
- mkmnt: true |
|
|
- mkmnt: true |
|
|
- opts: mode=775,pagesize={{ hugepages.size }} |
|
|
- opts: mode=775,pagesize={{ hugepages.size }} |
|
|
|
|
|
- mount: {{ hugepages.mount|default('true') }} |
|
|
|
|
|
|
|
|
# Make hugepages available right away with a temporary systctl write |
|
|
# Make hugepages available right away with a temporary systctl write |
|
|
# This will be handled via krn args after reboot, so don't use `sysctl.present` |
|
|
# This will be handled via krn args after reboot, so don't use `sysctl.present` |
|
|
|
|
|
{%- if hugepages.get('default', False) %} |
|
|
hugepages_sysctl_vm_nr_hugepages: |
|
|
hugepages_sysctl_vm_nr_hugepages: |
|
|
cmd.run: |
|
|
cmd.run: |
|
|
- name: "sysctl vm.nr_hugepages={{ hugepages.count }}" |
|
|
- name: "sysctl vm.nr_hugepages={{ hugepages.count }}" |
|
|
- unless: "sysctl vm.nr_hugepages | grep -qE '{{ hugepages.count }}'" |
|
|
- unless: "sysctl vm.nr_hugepages | grep -qE '{{ hugepages.count }}'" |
|
|
|
|
|
|
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
|
|
|
|
|
|
{%- endfor %} |
|
|
{%- endfor %} |