-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: add scripts for quiescing bare metal server
- Loading branch information
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
# This script is not general purpose, modify for your needs | ||
# All the changes are temporary and go away on boot | ||
# ref: https://llvm.org/docs/Benchmarking.html | ||
|
||
# Set performance governor | ||
for i in 0 1 2 3 4 5 6 7 | ||
do | ||
echo "performance" | sudo tee /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor | ||
done | ||
|
||
|
||
# Remove effects of SMT | ||
echo "off" | sudo tee /sys/devices/system/cpu/smt/control | ||
|
||
# Disable turbo boosting | ||
for cpu_no in 0 1 2 3 4 5 6 7 | ||
do | ||
echo 3000000 | sudo tee /sys/devices/system/cpu/cpufreq/policy$cpu_no/scaling_max_freq | ||
done | ||
|
||
# Disable ASLR | ||
echo 0 | sudo tee /proc/sys/kernel/randomize_va_space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
# Switch back performance governor | ||
for i in 0 1 2 3 4 5 6 7 | ||
do | ||
echo "powersave" | sudo tee /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor | ||
done | ||
|
||
|
||
# Enable SMT | ||
echo "on" | sudo tee /sys/devices/system/cpu/smt/control | ||
|
||
|
||
# Enable max turbo frequencies | ||
for cpu_no in 0 1 2 3 4 5 6 7 | ||
do | ||
echo 5389000 | sudo tee /sys/devices/system/cpu/cpufreq/policy$cpu_no/scaling_max_freq | ||
done | ||
|
||
# Enable ASLR | ||
echo 2 | sudo tee /proc/sys/kernel/randomize_va_space |