Skip to content

Commit

Permalink
ci: add scripts for quiescing bare metal server
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Dec 30, 2024
1 parent f77bb91 commit 0e5c5ef
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
27 changes: 27 additions & 0 deletions scripts/server_quiesce.sh
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
24 changes: 24 additions & 0 deletions scripts/server_unquiesce.sh
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

0 comments on commit 0e5c5ef

Please sign in to comment.