diff --git a/autorun.sh b/autorun.sh new file mode 100755 index 0000000000000000000000000000000000000000..230a10b9294bdc783288da18e1f42bd03e5d058d --- /dev/null +++ b/autorun.sh @@ -0,0 +1,52 @@ +#!/bin/bash +# Automatically run the set of experiments allowed on the current kernel +# Saves a little bit of work, though this is not really adaptable to other +# environments. + +run_exp() { + echo "Running: ./run.sh --force $@" + echo "----------------------------------------------" + ./run.sh --force $@ + if [ "$RUN_AUX_EXP" == "true" ]; then + for i in $(seq 1 10); do + echo "Running: ./run.sh --aux $i $@" + ./run.sh --aux $i $@ + done + fi +} + +# Common functions for memcached experiments +# Note that for some cases we can only run part of them; +# in that case we use run_exp directly instead of these helpers +run_memcached_qps_scan() { + [ "$SKIP_QPS_SCAN" == "true" ] && echo "Memcached QPS scan skipped" && return + [ "$SKIP_SINGLE_THREAD" == "true" ] || run_exp -e memcached_qps_scan -t 1 $@ + run_exp -e memcached_qps_scan -t 8 $@ +} + +run_memcached_conn_scan() { + [ "$SKIP_SINGLE_THREAD" == "true" ] || run_exp -e memcached_conn_scan -t 1 $@ + run_exp -e memcached_conn_scan -t 8 $@ +} + +[ "$UID" -ne 0 ] && exit 1 + +case "$(uname -r)" in + 5.15.79-peter) + # Custom kernel -- most things that matter can be run here + # Default -- no tuning + run_memcached_conn_scan + run_memcached_qps_scan + + # Kernel polling + run_memcached_conn_scan --extra-tuning kernel_polling + run_memcached_qps_scan --extra-tuning kernel_polling + + # IRQ packing + SKIP_SINGLE_THREAD=true run_memcached_conn_scan --extra-tuning irq_packing + SKIP_SINGLE_THREAD=true run_memcached_qps_scan --extra-tuning irq_packing + ;; + *) + echo "Unsupported kernel" + ;; +esac diff --git a/experiments/perf.shared.sh b/experiments/perf.shared.sh index 6012f24a608899f03d9edbfbf7bfc2d7d92eab96..ab082a285df03e351c90d855d3bbc88dd92cf3c0 100644 --- a/experiments/perf.shared.sh +++ b/experiments/perf.shared.sh @@ -1,5 +1,5 @@ perf_stat_start() { - $PERF stat -C 0-$((THREADS - 1)) -e LLC-load-misses:u,LLC-load-misses:k,mem_load_uops_retired.llc_miss,mem_uops_retired.all_loads,cycles,cycles:u,cycles:k,instructions,instructions:u,instructions:k,stalled-cycles-frontend,stalled-cycles-backend -o "$DATA_OUT/stat_$1$EXP_AUX_SUFFIX.txt" & + $PERF stat -C 0-$((THREADS - 1)) -e LLC-load-misses:u,LLC-load-misses:k,LLC-loads:u,LLC-loads:k,LLC-store-misses:u,LLC-store-misses:k,LLC-stores:u,LLC-stores:k,task-clock,cycles:u,cycles:k,instructions:u,instructions:k -o "$DATA_OUT/stat_$1$EXP_AUX_SUFFIX.txt" & PERF_STAT_PID=$! } diff --git a/run.sh b/run.sh index 02eb196b21c6ee8ea5a596491da9a9771313de44..60d6f0176c8cb5e3852f029ad2e6b97be3216bcd 100755 --- a/run.sh +++ b/run.sh @@ -138,9 +138,8 @@ if [ -d "$DATA_OUT" ] && [ -z "$EXP_AUX_SUFFIX" ]; then echo "Experiment directory $DATA_OUT already exists. Remove it manually or use --force. To run auxillary experiments for multiple sets of data, use --aux <num>" exit 1 fi -else - mkdir -p "$DATA_OUT" fi +mkdir -p "$DATA_OUT" run_exp