Created
June 14, 2019 08:41
-
-
Save ldu4/a5cc1a93f293108ea387d43d5d5e7f44 to your computer and use it in GitHub Desktop.
runit.sh
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
#!/bin/bash | |
#TESTS="page_fault1_processes page_fault1_threads page_fault2_processes page_fault2_threads page_fault3_processes page_fault3_threads" | |
TESTS="page_fault2_threads page_fault3_threads" | |
NRCPUS=`getconf _NPROCESSORS_ONLN` | |
echo "$HOSTNAME $NRCPUS cpus" | |
uname -r | |
function run_test() | |
{ | |
test=$1 | |
nrcpus=$2 | |
delay=$3 | |
for i in `seq 1 10`; do | |
./$test -t $nrcpus -s $delay | grep average | |
done | |
} | |
for test in $TESTS; do | |
echo "----------------------------------" | |
echo $test | |
outfile=$test.`uname -r`.out | |
rm -f $outfile | |
for thp in always never; do | |
sudo tee /sys/kernel/mm/transparent_hugepage/enabled <<< $thp | |
echo "#### THP $thp" >> $outfile | |
if [ -f /proc/sys/vm/speculative_page_fault ]; then | |
for spf in 0 1; do | |
echo "#### SPF $spf" >> $outfile | |
sudo tee /proc/sys/vm/speculative_page_fault <<< $spf | |
run_test $test $NRCPUS 5 >> $outfile | |
done | |
else | |
run_test $test $NRCPUS 5 >> $outfile | |
fi | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment