Add Skylake optimization to ansible 67/13367/2
authorPeter Mikus <pmikus@cisco.com>
Fri, 6 Jul 2018 05:18:01 +0000 (05:18 +0000)
committerPeter Mikus <pmikus@cisco.com>
Fri, 6 Jul 2018 06:47:06 +0000 (06:47 +0000)
- Add kernel params
- Add TurboBoost managing

Change-Id: I9d9561290f8f6780ff41f3a418a1f335d935d843
Signed-off-by: Peter Mikus <pmikus@cisco.com>
resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service [new file with mode: 0644]
resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml

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 (file)
index 0000000..e04729d
--- /dev/null
@@ -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
index eeaeed4..1774134 100644 (file)
@@ -52,7 +52,7 @@
     path: '/etc/default/grub'\r
     state: 'present'\r
     regexp: '^GRUB_CMDLINE_LINUX='\r
-    line: 'GRUB_CMDLINE_LINUX="isolcpus={{ isolcpus }} nohz_full={{ isolcpus }} rcu_nocbs={{ isolcpus }} numa_balancing=disable intel_pstate=disable intel_iommu=on iommu=pt"'\r
+    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"'\r
   notify: ['Update GRUB']\r
   tags: set-grub\r
 \r
   tags: install-pip\r
 \r
 - name: Load vfio-pci by default\r
-  raw: 'echo vfio-pci | sudo tee -a /etc/modules'\r
+  lineinfile:\r
+    path: '/etc/modules'\r
+    state: 'present'\r
+    line: 'vfio-pci'\r
   tags: load-vfio-pci\r
+\r
+- name: Load msr by default\r
+  lineinfile:\r
+    path: '/etc/modules'\r
+    state: 'present'\r
+    line: 'msr'\r
+  tags: disable-turbo-boost\r
+\r
+- name: Disable Turbo-Boost by service\r
+  copy:\r
+    src: 'files/disable-turbo-boost.service'\r
+    dest: '/etc/systemd/system/disable-turbo-boost.service'\r
+    owner: 'root'\r
+    group: 'root'\r
+    mode: '0644'\r
+  when: >\r
+        inventory_hostname in groups['skylake']\r
+  tags: disable-turbo-boost\r
+\r
+- name: Disable Turbo-Boost by service on startup\r
+  service:\r
+    name: disable-turbo-boost\r
+    enabled: yes\r
+  when: >\r
+        inventory_hostname in groups['skylake']\r
+  tags: disable-turbo-boost\r

©2016 FD.io a Linux Foundation Collaborative Project. All Rights Reserved.
Linux Foundation is a registered trademark of The Linux Foundation. Linux is a registered trademark of Linus Torvalds.
Please see our privacy policy and terms of use.