diff options
Diffstat (limited to 'resources/tools/testbed-setup/ansible')
-rw-r--r-- | resources/tools/testbed-setup/ansible/roles/tg_sut/files/disable-turbo-boost.service | 10 | ||||
-rw-r--r-- | resources/tools/testbed-setup/ansible/roles/tg_sut/tasks/main.yaml | 33 |
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
|