summaryrefslogtreecommitdiffstats
path: root/smt_analysis_rtss20
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:36:21 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:36:21 -0400
commite5db76ee18640ce27df8756e573ef8b497af4750 (patch)
tree8442b5f064f93c02906f4ef48cdb478cf627b4d2 /smt_analysis_rtss20
parentecf6547fdce39b3ec0f333c9b391b0f1c25deba5 (diff)
All the TACLeBench runner scripts as used for the (rejected) RTSS'20 submission
Everything without isolation: run_tacle_rtss20.sh For isolation you have to run the hodgepodge of scripts as before.
Diffstat (limited to 'smt_analysis_rtss20')
-rwxr-xr-xsmt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh161
1 files changed, 161 insertions, 0 deletions
diff --git a/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh b/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh
new file mode 100755
index 0000000..923dba0
--- /dev/null
+++ b/smt_analysis_rtss20/run_all_pairs_Level-C_TACLe.sh
@@ -0,0 +1,161 @@
1#!/bin/bash
2
3firstCore=$1
4secondCore=$2
5maxJobs=$3
6userRunID=$4
7tacleNames=tacleNames.txt
8
9if [ $# -lt 4 ]; then
10 echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]"
11 exit
12fi
13
14if [ $# -gt 4 ]; then
15 echo "Using alternate list of TACLe benchmarks from $5"
16 tacleNames=$5
17fi
18
19if [ "$EUID" -ne 0 ]
20then
21 echo "You need to be root to enable interrupt isolation and real-time execution!"
22 exit
23fi
24
25echo "Making sure that binaries are up to date..."
26while read i; do
27 make bin/$i
28done < $tacleNames
29echo "Done. Disabling real-time throttling..."
30
31# Turn off rt throttling
32echo -1 > /proc/sys/kernel/sched_rt_runtime_us
33echo "Done. Redirecting all interrupts to core 0..."
34
35# Redirect all interrupts to core 0
36i=0
37for IRQ in /proc/irq/*
38do
39 # Skip default_smp_affinity
40 if [ -d $IRQ ]; then
41 irqList[$i]=$(cat $IRQ/smp_affinity_list)
42 echo 0 2> /dev/null > $IRQ/smp_affinity_list
43 fi
44 i=$(( $i + 1 ))
45done
46
47# Read the names of each benchmark
48j=0
49while read i; do
50 tacleProg[$j]=$i
51 j=$(( $j + 1 ))
52done < $tacleNames
53
54echo "Done. Checking for wbinvd module..."
55if [[ ! -f "/proc/wbinvd" ]]; then
56 echo "ERROR: wbinvd module not loaded. Exiting..."
57 exit
58fi
59
60# Enable L3 isolation
61echo "Done. Enabling L3 isolation..."
62mount -t resctrl resctrl /sys/fs/resctrl
63mkdir -p /sys/fs/resctrl/benchmarks
64echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list
65echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list
66# Reset global bandwith control and remove L3 from global
67echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
68echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
69# Alloc L3 to benchmark
70echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
71echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
72echo "Done. Verifying configuration with user..."
73
74# Generate file name string
75# We append to this as we parse the environment settings
76runID=$(date +"%b%d-%H")
77
78# Confirm configuration with user
79echo "=== Global Config ==="
80cat /sys/fs/resctrl/schemata
81echo "=== Core $firstCore and $secondCore Config ==="
82cat /sys/fs/resctrl/benchmarks/schemata
83if [[ $6 == "--contend" ]]; then
84 if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then
85 echo "ERROR: thrasher binary not fonud. Exiting..."
86 exit
87 fi
88 echo "Will run 6 contending tasks"
89 runID=$runID-c
90else
91 runID=$runID-xc
92fi
93if uname -a | grep -q "mc2"; then
94 echo "MC^2 Autodetected. Cache coloring will be DISABLED."
95 runID=$runID-i
96else
97 echo "MC^2 not detected. Cache coloring will be DISABLED."
98 runID=$runID-xi
99fi
100echo "Results will be saved as $runID-$userRunID-LC-TACLe.txt"
101echo "Press enter to confirm environment, Ctrl-C to exit..."
102read
103
104# Start contending tasks
105if [[ $6 == "--contend" ]]; then
106 echo "Done. Starting 6 contending tasks..."
107 # Run two contending tasks on each other CCX
108 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
109 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
110 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
111 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
112 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
113 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
114fi
115sleep 1 # Wait for contending tasks to start
116echo "Done. Beginning benchmarks..."
117
118num_tests=$(wc -l < $tacleNames)
119for (( i = 0; i < $num_tests ; i++ ))
120do
121 # For level-C analysis, we must run all vs all
122 for (( j = 0; j < $num_tests ; j++ )) #loop through programs
123 do
124 # Autodetect MC^2
125 if uname -a | grep -q "mc2"; then
126 # -1 loops means loop forever
127 chrt -r 97 numactl --interleave=all taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 & PID1=$!;
128 chrt -r 97 numactl --interleave=all taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-TACLe 1 & PID2=$!;
129 else
130 chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 & PID1=$!;
131 chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-TACLe 1 & PID2=$!;
132 fi
133 # The paired task runs continuously in this configuration, so we have
134 # to kill it once the task that we're measuring finishes.
135 wait $PID2
136 kill $PID1
137 echo ${tacleProg[$i]} ${tacleProg[$j]}
138 done
139 echo COMPLETE: ${tacleProg[$i]}
140done
141
142# End contending tasks
143if [[ $6 == "--contend" ]]; then
144 killall thrasher
145fi
146
147# Remove semaphores from system
148# Leaving them won't hurt these tests, but would be messy and is bad practice
149# TODO: Do this directly in the benchmarks. They should clean up after themselves
150./bin/cleanupSemaphores
151
152# Put smp_affinty back the way it was
153i=0
154for IRQ in /proc/irq/*
155do
156 if [ -d $IRQ ]; then
157 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
158 fi
159 i=$(( $i + 1 ))
160done
161