Grub hugepages configuration and mount point action. Change-Id: I49b26871c325b95a7d3f264892a9e997b58765bc Epic: PROD-8959tags/2017.4
cpu: | cpu: | ||||
governor: performance | governor: performance | ||||
Huge Pages | |||||
~~~~~~~~~~~~ | |||||
Huge Pages give a performance boost to applications that intensively deal | |||||
with memory allocation/deallocation by decreasing memory fragmentation. | |||||
.. code-block:: yaml | |||||
linux: | |||||
system: | |||||
kernel: | |||||
hugepages: | |||||
small: | |||||
size: 2M | |||||
count: 107520 | |||||
mount_point: /mnt/hugepages_2MB | |||||
mount: false/true # default false | |||||
large: | |||||
default: true # default automatically mounted | |||||
size: 1G | |||||
count: 210 | |||||
mount_point: /mnt/hugepages_1GB | |||||
Note: not recommended to use both pagesizes in concurrently. | |||||
Repositories | Repositories |
{%- from "linux/map.jinja" import system with context %} | |||||
GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT {%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %}{%- if hugepages.get('default', False) %} default_hugepagesz={{ hugepages.size }} {%- endif %} hugepagesz={{ hugepages.size }} hugepages={{ hugepages.count }} {%- endfor %}" |
{%- from "linux/map.jinja" import system with context %} | |||||
{%- if "pse" in grains.cpu_flags or "pdpe1gb" in grains.cpu_flags %} | |||||
/etc/default/grub.d/90-hugepages.cfg: | |||||
file.managed: | |||||
- source: salt://linux/files/grub_hugepages | |||||
- template: jinja | |||||
{%- for hugepages_type, hugepages in system.kernel.hugepages.iteritems() %} | |||||
{%- if hugepages.get('mount', False) or hugepages.get('default', False) %} | |||||
hugepages_mount_{{ hugepages_type }}: | |||||
mount.mounted: | |||||
- name: {{ hugepages.mount_point }} | |||||
- device: Hugetlbfs-kvm | |||||
- fstype: hugetlbfs | |||||
- mkmnt: true | |||||
- opts: mode=775,pagesize={{ hugepages.size }} | |||||
{%- endif %} | |||||
{%- endfor %} | |||||
{%- endif %} |
{%- endif %} | {%- endif %} | ||||
{%- if system.kernel is defined %} | {%- if system.kernel is defined %} | ||||
- linux.system.kernel | - linux.system.kernel | ||||
{%- if system.kernel.hugepages is defined %} | |||||
- linux.system.hugepages | |||||
{%- endif %} | |||||
{%- endif %} | {%- endif %} | ||||
{%- if system.cpu is defined %} | {%- if system.cpu is defined %} | ||||
- linux.system.cpu | - linux.system.cpu | ||||
{%- endif %} | {%- endif %} | ||||
{%- if system.config is defined %} | {%- if system.config is defined %} | ||||
- linux.system.config | - linux.system.config | ||||
{%- endif %} | |||||
{%- endif %} |
term: xterm | term: xterm | ||||
prompt: | prompt: | ||||
default: "test01.local$" | default: "test01.local$" | ||||
kernel: | |||||
hugepages: | |||||
large: | |||||
default: true | |||||
size: 1G | |||||
count: 210 | |||||
mount_point: /mnt/hugepages_1GB | |||||
motd: | motd: | ||||
- warning: | | - warning: | | ||||
#!/bin/sh | #!/bin/sh |