Browse Source

Implement isolcpu grub configuration

Separate cpu for host os from workload.

Change-Id: I5b274a6324fe2fa47c09df82c01e3b95dadb5e53
Epic: PROD-8959
tags/2017.4
Jakub Pavlik 8 years ago
parent
commit
6c9ead164d
3 changed files with 31 additions and 0 deletions
  1. +14
    -0
      README.rst
  2. +15
    -0
      linux/system/kernel.sls
  3. +2
    -0
      tests/pillar/system.sls

+ 14
- 0
README.rst View File

echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a echo 7 > /sys/class/net/eth1/device/sriov_numvfs; sleep 2; ifup -a
exit 0 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 Repositories
~~~~~~~~~~~~ ~~~~~~~~~~~~

+ 15
- 0
linux/system/kernel.sls View File



{%- if system.kernel is defined %} {%- 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 %} {%- if system.kernel.version is defined %}


linux_kernel_package: linux_kernel_package:

+ 2
- 0
tests/pillar/system.sls View File

prompt: prompt:
default: "test01.local$" default: "test01.local$"
kernel: kernel:
sriov: True
isolcpu: 1,2,3,4
hugepages: hugepages:
large: large:
default: true default: true

Loading…
Cancel
Save