Skip to content

Commit 15cbddc

Browse files
committed
Fix CPU C state handling
1 parent 8ad6541 commit 15cbddc

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

build/infrastructure/aws/main.tf

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,12 @@ EOF
117117
"export INFRA_DOCKER_REGISTRY=\"${var.docker_registry}\"",
118118
"export INFRA_DOCKER_REPOSITORY=\"${var.docker_repository}\"",
119119

120-
"# Run the benchmark",
120+
"# Setup the benchmark",
121121
"${var.remote_project_root}/bin/build.sh $INFRA_ENVIRONMENT",
122122
"${var.remote_project_root}/bin/setup.sh",
123123

124-
var.disable_deeper_c_states ? "sudo sed -i 's/rd\\.shell=0\"/rd.shell=0 intel_idle.max_cstate=1\"/' /etc/default/grub && sudo grub2-mkconfig -o /boot/grub2/grub.cfg" : "echo 'skipped disabling deeper C states'",
124+
var.disable_deeper_c_states ? "sudo sed -i 's/quiet\"/quiet intel_idle.max_cstate=1 processor.max_cstate=1\"/' /etc/default/grub && sudo grub2-mkconfig -o /boot/grub2/grub.cfg" : "echo 'skipped disabling deeper C states'",
125+
"# original: GRUB_CMDLINE_LINUX_DEFAULT=\"console=tty0 console=ttyS0,115200n8 nvme_core.io_timeout=4294967295 rd.emergency=poweroff rd.shell=0 selinux=1 security=selinux quiet intel_idle.max_cstate=1 processor.max_cstate=1\""
125126
]
126127
}
127128

@@ -158,6 +159,9 @@ EOF
158159
var.disable_hyper_threading ? "for cpunum in $(cat /sys/devices/system/cpu/cpu*/topology/thread_siblings_list | cut -s -d, -f2- | tr ',' '\n' | sort -un); do echo 0 | sudo tee /sys/devices/system/cpu/cpu$cpunum/online; done" : "echo 'skipped disabling hyper threading'",
159160
var.disable_turbo_boost ? "sudo sh -c 'echo 1 > /sys/devices/system/cpu/intel_pstate/no_turbo'" : "echo 'skipped disabling turbo boost'",
160161

162+
# Verify CPU settings
163+
"sudo cat /etc/default/grub",
164+
161165
"${var.remote_project_root}/bin/benchmark.sh",
162166
]
163167
}

0 commit comments

Comments
 (0)