Kaynağa Gözat

Hugepages support

Grub hugepages configuration and mount point action.

Change-Id: I49b26871c325b95a7d3f264892a9e997b58765bc
Epic: PROD-8959
tags/2017.4
Jakub Pavlik 7 yıl önce
ebeveyn
işleme
b148c8ca8e
5 değiştirilmiş dosya ile 63 ekleme ve 1 silme
  1. +24
    -0
      README.rst
  2. +2
    -0
      linux/files/grub_hugepages
  3. +26
    -0
      linux/system/hugepages.sls
  4. +4
    -1
      linux/system/init.sls
  5. +7
    -0
      tests/pillar/system.sls

+ 24
- 0
README.rst Dosyayı Görüntüle

@@ -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

+ 2
- 0
linux/files/grub_hugepages Dosyayı Görüntüle

@@ -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 %}"

+ 26
- 0
linux/system/hugepages.sls Dosyayı Görüntüle

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

+ 4
- 1
linux/system/init.sls Dosyayı Görüntüle

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

+ 7
- 0
tests/pillar/system.sls Dosyayı Görüntüle

@@ -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

Yükleniyor…
İptal
Kaydet