aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/testbed-setup/ansible/roles
diff options
context:
space:
mode:
authorPeter Mikus <pmikus@cisco.com>2018-07-06 05:18:01 +0000
committerPeter Mikus <pmikus@cisco.com>2018-07-06 06:47:06 +0000
commit3354994941d5f8d27c53981dade9dd6c8d276cfb (patch)
treed4fc97bc76e68e7adec66f876877f3f981d209e2 /resources/tools/testbed-setup/ansible/roles
parentb0aa215df352276c6aed3663dce947ed68749bb1 (diff)
Add Skylake optimization to ansible
- Add kernel params - Add TurboBoost managing Change-Id: I9d9561290f8f6780ff41f3a418a1f335d935d843 Signed-off-by: Peter Mikus <pmikus@cisco.com>
Diffstat (limited to 'resources/tools/testbed-setup/ansible/roles')
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service10
-rw-r--r--resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml33
2 files changed, 41 insertions, 2 deletions
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service b/resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service
new file mode 100644
index 0000000000..e04729de50
--- /dev/null
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Disable Turbo Boost on Intel CPU
+
+[Service]
+ExecStart=/bin/sh -c 'for core in `cat /proc/cpuinfo | grep processor | awk \'{print $3}\'`; do sudo wrmsr -p$core 0x1a0 0x4000850089; done'
+ExecStop=/bin/sh -c 'for core in `cat /proc/cpuinfo | grep processor | awk \'{print $3}\'`; do sudo wrmsr -p$core 0x1a0 0x850089; done'
+RemainAfterExit=yes
+
+[Install]
+WantedBy=sysinit.target
diff --git a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
index eeaeed4ffb..1774134abe 100644
--- a/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
+++ b/resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml
@@ -52,7 +52,7 @@
path: '/etc/default/grub'
state: 'present'
regexp: '^GRUB_CMDLINE_LINUX='
- line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt"'
+ line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt nmi_watchdog=0 audit=0 nosoftlockup processor.max_cstate=1 intel_idle.max_cstate=1 hpet=disable tsc=reliable mce=off"'
notify: ['Update GRUB']
tags: set-grub
@@ -68,5 +68,34 @@
tags: install-pip
- name: Load vfio-pci by default
- raw: 'echo vfio-pci | sudo tee -a /etc/modules'
+ lineinfile:
+ path: '/etc/modules'
+ state: 'present'
+ line: 'vfio-pci'
tags: load-vfio-pci
+
+- name: Load msr by default
+ lineinfile:
+ path: '/etc/modules'
+ state: 'present'
+ line: 'msr'
+ tags: disable-turbo-boost
+
+- name: Disable Turbo-Boost by service
+ copy:
+ src: 'files/disable-turbo-boost.service'
+ dest: '/etc/systemd/system/disable-turbo-boost.service'
+ owner: 'root'
+ group: 'root'
+ mode: '0644'
+ when: >
+ inventory_hostname in groups['skylake']
+ tags: disable-turbo-boost
+
+- name: Disable Turbo-Boost by service on startup
+ service:
+ name: disable-turbo-boost
+ enabled: yes
+ when: >
+ inventory_hostname in groups['skylake']
+ tags: disable-turbo-boost