Skip to content
Snippets Groups Projects
Commit 610d6814 authored by Peter Cai's avatar Peter Cai
Browse files

Add first CPU offset for NUMA

parent f7a70f6e
No related branches found
No related tags found
No related merge requests found
perf_stat_start() { perf_stat_start() {
local opt_args="" local opt_args=""
if [ "$PERF_STAT_NO_CORES" != "true" ]; then if [ "$PERF_STAT_NO_CORES" != "true" ]; then
opt_args="$opt_args -C 0-$((THREADS - 1))" opt_args="$opt_args -C $FIRST_CPU-$((FIRST_CPU + THREADS - 1))"
fi fi
$PERF stat $PERF_EXTRA_ARGS $opt_args -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 $PERF_EXTRA_ARGS $opt_args -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=$! PERF_STAT_PID=$!
...@@ -14,7 +14,7 @@ perf_stat_stop() { ...@@ -14,7 +14,7 @@ perf_stat_stop() {
perf_record_start() { perf_record_start() {
local opt_args="" local opt_args=""
if [ "$PERF_STAT_NO_CORES" != "true" ]; then if [ "$PERF_STAT_NO_CORES" != "true" ]; then
opt_args="$opt_args -C 0-$((THREADS - 1))" opt_args="$opt_args -C $FIRST_CPU-$((FIRST_CPU + THREADS - 1))"
fi fi
pushd "$DATA_OUT" pushd "$DATA_OUT"
......
...@@ -28,8 +28,8 @@ cleanup_memcached() { ...@@ -28,8 +28,8 @@ cleanup_memcached() {
start_memcached() { start_memcached() {
echo "Starting memcached" echo "Starting memcached"
echo "taskset -c 0-$((THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler" echo "taskset -c $FIRST_CPU-$((FIRST_CPU + THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler"
taskset -c 0-$((THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler & taskset -c $FIRST_CPU-$((FIRST_CPU + THREADS - 1 - THREAD_TAIL_OFFSET)) $MEMCACHED $MEMCACHED_ARGS -u root -t $((THREADS - THREAD_TAIL_OFFSET)) -b 16384 -c 32768 -m 10240 -o hashpower=24,no_lru_maintainer,no_lru_crawler &
MEMCACHED_PID=$! MEMCACHED_PID=$!
if [ "$PERF_STAT_ONLY_MEMCACHED" == "true" ]; then if [ "$PERF_STAT_ONLY_MEMCACHED" == "true" ]; then
PERF_EXTRA_ARGS_ORIG="$PERF_EXTRA_ARGS" PERF_EXTRA_ARGS_ORIG="$PERF_EXTRA_ARGS"
......
...@@ -8,6 +8,7 @@ if [ "$UID" -ne 0 ]; then ...@@ -8,6 +8,7 @@ if [ "$UID" -ne 0 ]; then
fi fi
EXTRA_TUNING=() EXTRA_TUNING=()
FIRST_CPU=0
export EXP_ROOT="$PWD" export EXP_ROOT="$PWD"
...@@ -38,6 +39,11 @@ while [[ $# -gt 0 ]]; do ...@@ -38,6 +39,11 @@ while [[ $# -gt 0 ]]; do
shift shift
shift shift
;; ;;
--first-cpu)
FIRST_CPU=$2
shift
shift
;;
--fstack) --fstack)
FSTACK=true FSTACK=true
USERSTACK=true USERSTACK=true
...@@ -122,6 +128,9 @@ if [ "${#EXTRA_TUNING[@]}" -gt 0 ]; then ...@@ -122,6 +128,9 @@ if [ "${#EXTRA_TUNING[@]}" -gt 0 ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.$tuning" EXPERIMENT_NAME="$EXPERIMENT_NAME.$tuning"
done done
fi fi
if [ $FIRST_CPU -gt 0 ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.first$FIRST_CPU"
fi
if [ "$FSTACK" == "true" ]; then if [ "$FSTACK" == "true" ]; then
EXPERIMENT_NAME="$EXPERIMENT_NAME.fstack" EXPERIMENT_NAME="$EXPERIMENT_NAME.fstack"
fi fi
......
if [ "$FIRST_CPU" -ne 0 ]; then
echo "FIRST_CPU must be 0"
exit 1
fi
$EXP_ROOT/irq.sh set 16 $((THREADS + 16 - 1)) $EXP_ROOT/irq.sh set 16 $((THREADS + 16 - 1))
$EXP_ROOT/irq.sh set rx 16 $((THREADS + 16 - 1)) $EXP_ROOT/irq.sh set rx 16 $((THREADS + 16 - 1))
if [ "$THREADS" -ne 8 ]; then if [ "$THREADS" -ne 8 ] || [ "$FIRST_CPU" -ne 0 ]; then
echo "IRQ packing can only be done with 8 threads" echo "IRQ packing can only be done with 8 threads and FIRST_CPU must be 0"
exit 1 exit 1
fi fi
......
ethtool -L $NET_IF rx $THREADS tx $THREADS || true ethtool -L $NET_IF rx $THREADS tx $THREADS || true
$EXP_ROOT/irq.sh set 0 $((THREADS - 1)) $EXP_ROOT/irq.sh set $FIRST_CPU $((FIRST_CPU + THREADS - 1))
$EXP_ROOT/irq.sh set rx 0 $((THREADS - 1)) $EXP_ROOT/irq.sh set rx $FIRST_CPU $((FIRST_CPU + THREADS - 1))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment