Explorar el Código

Implement isolcpu grub configuration

Separate cpu for host os from workload.

Change-Id: I5b274a6324fe2fa47c09df82c01e3b95dadb5e53
Epic: PROD-8959
tags/2017.4
Jakub Pavlik hace 8 años
padre
commit
6c9ead164d
Se han modificado 3 ficheros con 31 adiciones y 0 borrados
  1. +14
    -0
      README.rst
  2. +15
    -0
      linux/system/kernel.sls
  3. +2
    -0
      tests/pillar/system.sls

+ 14
- 0
README.rst Ver fichero

@@ -288,6 +288,20 @@ PCI-SIG Single Root I/O Virtualization and Sharing (SR-IOV) specification define
echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
exit 0

Isolate CPU options
~~~~~~~~~~~~~~~~~~~

Remove the specified CPUs, as defined by the cpu_number values, from the general kernel
SMP balancing and scheduler algroithms. The only way to move a process onto or off an
"isolated" CPU is via the CPU affinity syscalls. cpu_number begins at 0, so the
maximum value is 1 less than the number of CPUs on the system.

.. code-block:: yaml

linux:
system:
kernel:
isolcpu: 1,2,3,4,5,6,7 # isolate first cpu 0

Repositories
~~~~~~~~~~~~

+ 15
- 0
linux/system/kernel.sls Ver fichero

@@ -3,6 +3,21 @@

{%- if system.kernel is defined %}

{%- if system.kernel.isolcpu is defined %}

include:
- linux.system.grub

/etc/default/grub.d/90-isolcpu.cfg:
file.managed:
- contents: 'GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT isolcpu={{ system.kernel.isolcpu }}"'
- require:
- file: grub_d_directory
- watch_in:
- cmd: grub_update

{%- endif %}

{%- if system.kernel.version is defined %}

linux_kernel_package:

+ 2
- 0
tests/pillar/system.sls Ver fichero

@@ -20,6 +20,8 @@ linux:
prompt:
default: "test01.local$"
kernel:
sriov: True
isolcpu: 1,2,3,4
hugepages:
large:
default: true

Cargando…
Cancelar
Guardar