Grub hugepages configuration and mount point action. Change-Id: I49b26871c325b95a7d3f264892a9e997b58765bc Epic: PROD-8959tags/2017.4
@@ -217,6 +217,30 @@ Disable ondemand cpu mode service: | |||
cpu: | |||
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 |
@@ -0,0 +1,2 @@ | |||
{%- 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 %}" |
@@ -0,0 +1,26 @@ | |||
{%- 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 %} |
@@ -11,6 +11,9 @@ include: | |||
{%- endif %} | |||
{%- if system.kernel is defined %} | |||
- linux.system.kernel | |||
{%- if system.kernel.hugepages is defined %} | |||
- linux.system.hugepages | |||
{%- endif %} | |||
{%- endif %} | |||
{%- if system.cpu is defined %} | |||
- linux.system.cpu | |||
@@ -65,4 +68,4 @@ include: | |||
{%- endif %} | |||
{%- if system.config is defined %} | |||
- linux.system.config | |||
{%- endif %} | |||
{%- endif %} |
@@ -19,6 +19,13 @@ linux: | |||
term: xterm | |||
prompt: | |||
default: "test01.local$" | |||
kernel: | |||
hugepages: | |||
large: | |||
default: true | |||
size: 1G | |||
count: 210 | |||
mount_point: /mnt/hugepages_1GB | |||
motd: | |||
- warning: | | |||
#!/bin/sh |