Selaa lähdekoodia

Mend hugepages config

* make unique mounted device
* hugepages realtime setup for default pagesize only

Change-Id: Ifa369f62a993c59c7b2c471b273fa795cc794e24
Closes-Bug: PROD-19825
pull/143/merge
Michael Polenchuk 6 vuotta sitten
vanhempi
commit
d9369fe835
2 muutettua tiedostoa jossa 4 lisäystä ja 5 poistoa
  1. +1
    -1
      README.rst
  2. +3
    -4
      linux/system/hugepages.sls

+ 1
- 1
README.rst Näytä tiedosto

size: 2M size: 2M
count: 107520 count: 107520
mount_point: /mnt/hugepages_2MB mount_point: /mnt/hugepages_2MB
mount: false/true # default false
mount: false/true # default is true (mount immediately) / false (just save in the fstab)
large: large:
default: true # default automatically mounted default: true # default automatically mounted
size: 1G size: 1G

+ 3
- 4
linux/system/hugepages.sls Näytä tiedosto



{%- 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 %}

Loading…
Peruuta
Tallenna