summaryrefslogtreecommitdiffstats
path: root/baseline
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 /baseline
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 'baseline')
-rwxr-xr-xbaseline/run_baseline.sh108
-rwxr-xr-xbaseline/run_baseline_L3_ONLY.sh152
2 files changed, 249 insertions, 11 deletions
diff --git a/baseline/run_baseline.sh b/baseline/run_baseline.sh
index f7a98fa..c5b67b6 100755
--- a/baseline/run_baseline.sh
+++ b/baseline/run_baseline.sh
@@ -2,11 +2,11 @@
2 2
3core=$1 3core=$1
4maxJobs=$2 4maxJobs=$2
5runID=$3 5userRunID=$3
6tacleNames=tacleNames.txt 6tacleNames=tacleNames.txt
7 7
8if [ $# -lt 3 ]; then 8if [ $# -lt 3 ]; then
9 echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file]" 9 echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]"
10 exit 10 exit
11fi 11fi
12 12
@@ -15,6 +15,12 @@ if [ $# -gt 3 ]; then
15 tacleNames=$4 15 tacleNames=$4
16fi 16fi
17 17
18if [ "$EUID" -ne 0 ]
19then
20 echo "You need to be root to enable interrupt isolation and real-time execution!"
21 exit
22fi
23
18echo "Making sure that binaries are up to date..." 24echo "Making sure that binaries are up to date..."
19while read i; do 25while read i; do
20 make bin/$i 26 make bin/$i
@@ -32,11 +38,10 @@ do
32 # Skip default_smp_affinity 38 # Skip default_smp_affinity
33 if [ -d $IRQ ]; then 39 if [ -d $IRQ ]; then
34 irqList[$i]=$(cat $IRQ/smp_affinity_list) 40 irqList[$i]=$(cat $IRQ/smp_affinity_list)
35 echo 0 > $IRQ/smp_affinity_list 41 echo 0 2> /dev/null > $IRQ/smp_affinity_list
36 fi 42 fi
37 i=$(( $i + 1 )) 43 i=$(( $i + 1 ))
38done 44done
39echo "Done. Beginning benchmarks..."
40 45
41# Read the names of each benchmark 46# Read the names of each benchmark
42j=0 47j=0
@@ -45,25 +50,106 @@ while read i; do
45 j=$(( $j + 1 )) 50 j=$(( $j + 1 ))
46done < $tacleNames 51done < $tacleNames
47 52
53echo "Done. Checking for wbinvd module..."
54if [[ ! -f "/proc/wbinvd" ]]; then
55 echo "ERROR: wbinvd module not loaded. Exiting..."
56 exit
57fi
58
59echo "Done. Setting cores $firstCore and $secondCore to 'performance'..."
60echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor
61echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governo
62
63# Enable L3 isolation
64echo "Done. Enabling L3 isolation..."
65mount -t resctrl resctrl /sys/fs/resctrl
66mkdir -p /sys/fs/resctrl/benchmarks
67echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
68# Reset global bandwith control and remove L3 from global
69echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
70echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
71# Alloc L3 to benchmark
72echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
73echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
74echo "Done. Verifying configuration with user..."
75
76# Generate file name string
77# We append to this as we parse the environment settings
78runID=$(date +"%b%d-%H")
79
80# Confirm configuration with user
81echo "=== Global Config ==="
82cat /sys/fs/resctrl/schemata
83echo "=== Core $1 Config ==="
84cat /sys/fs/resctrl/benchmarks/schemata
85if [[ $5 == "--contend" ]]; then
86 if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then
87 echo "ERROR: thrasher binary not fonud. Exiting..."
88 exit
89 fi
90 echo "Will run 6 contending tasks"
91 runID=$runID-c
92else
93 runID=$runID-xc
94fi
95if uname -a | grep -q "mc2"; then
96 echo "MC^2 Autodetected. Cache coloring and interleaving will be enabled."
97 runID=$runID-i
98else
99 echo "MC^2 not detected."
100 runID=$runID-xi
101fi
102if pwd | grep -qi dis; then
103 echo "Autodetected DIS. Will use script-level looping."
104fi
105echo "Results will be saved as $runID-$userRunID.txt"
106echo "Press enter to confirm environment, Ctrl-C to exit..."
107read
108
109# Start contending tasks
110if [[ $5 == "--contend" ]]; then
111 echo "Done. Starting 6 contending tasks..."
112 # Run two contending tasks on each other CCX
113 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
114 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
115 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
116 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
117 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
118 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
119fi
120sleep 1 # Wait for contending tasks to start
121echo "Done. Beginning benchmarks..."
48 122
49num_tests=$(wc -l < $tacleNames) 123num_tests=$(wc -l < $tacleNames)
50for (( i = 0; i < $num_tests ; i++ )) 124for (( i = 0; i < $num_tests ; i++ ))
51do 125do
52 # Check if we're using LITMUS^RT or not 126 # If using DIS, we have to iterate in the script as DIS won't do it for us
53 if grep -q "#define LITMUS 1" source/extra.h; then 127 pwd | grep -qi dis
54 ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID 1 128 iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))")
55 else 129 for ((k=0;k<=iters;k++)); do
56 chrt -r 97 taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID 1 130 # Check if we're using LITMUS^RT or not
57 fi 131 if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then
132 ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1
133 else
134 # Interleave memory allocations between all nodes (only 1 node w/out MC^2)
135 chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1
136#chrt -r 97 numactl -m 0 taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID-NOINTERLEAVE 1
137 fi
138 done
58 echo COMPLETE: ${tacleProg[$i]} 139 echo COMPLETE: ${tacleProg[$i]}
59done 140done
60 141
142# End contending tasks
143if [[ $5 == "--contend" ]]; then
144 killall thrasher
145fi
146
61# Put smp_affinty back the way it was 147# Put smp_affinty back the way it was
62i=0 148i=0
63for IRQ in /proc/irq/* 149for IRQ in /proc/irq/*
64do 150do
65 if [ -d $IRQ ]; then 151 if [ -d $IRQ ]; then
66 echo ${irqList[$i]} > $IRQ/smp_affinity_list 152 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
67 fi 153 fi
68 i=$(( $i + 1 )) 154 i=$(( $i + 1 ))
69done 155done
diff --git a/baseline/run_baseline_L3_ONLY.sh b/baseline/run_baseline_L3_ONLY.sh
new file mode 100755
index 0000000..4183653
--- /dev/null
+++ b/baseline/run_baseline_L3_ONLY.sh
@@ -0,0 +1,152 @@
1#!/bin/bash
2
3core=$1
4maxJobs=$2
5userRunID=$3
6tacleNames=tacleNames.txt
7
8if [ $# -lt 3 ]; then
9 echo "Usage $0 <core ID> <number of iterations> <run ID> [TACLe names file] [--contend]"
10 exit
11fi
12
13if [ $# -gt 3 ]; then
14 echo "Using alternate list of TACLe benchmarks from $4"
15 tacleNames=$4
16fi
17
18if [ "$EUID" -ne 0 ]
19then
20 echo "You need to be root to enable interrupt isolation and real-time execution!"
21 exit
22fi
23
24echo "Making sure that binaries are up to date..."
25while read i; do
26 make bin/$i
27done < $tacleNames
28echo "Done. Disabling real-time throttling..."
29
30# Turn off rt throttling
31echo -1 > /proc/sys/kernel/sched_rt_runtime_us
32echo "Done. Redirecting all interrupts to core 0..."
33
34# Redirect all interrupts to core 0
35i=0
36for IRQ in /proc/irq/*
37do
38 # Skip default_smp_affinity
39 if [ -d $IRQ ]; then
40 irqList[$i]=$(cat $IRQ/smp_affinity_list)
41 echo 0 2> /dev/null > $IRQ/smp_affinity_list
42 fi
43 i=$(( $i + 1 ))
44done
45
46# Read the names of each benchmark
47j=0
48while read i; do
49 tacleProg[$j]=$i
50 j=$(( $j + 1 ))
51done < $tacleNames
52
53echo "Done. Checking for wbinvd module..."
54if [[ ! -f "/proc/wbinvd" ]]; then
55 echo "ERROR: wbinvd module not loaded. Exiting..."
56 exit
57fi
58
59# Enable L3 isolation
60echo "Done. Enabling L3 isolation..."
61mount -t resctrl resctrl /sys/fs/resctrl
62mkdir -p /sys/fs/resctrl/benchmarks
63echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
64# Reset global bandwith control and remove L3 from global
65echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
66echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
67# Alloc L3 to benchmark
68echo "L3:0=0000;1=0000;2=0000;3=00ff" > /sys/fs/resctrl/benchmarks/schemata
69echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
70echo "Done. Verifying configuration with user..."
71
72# Generate file name string
73# We append to this as we parse the environment settings
74runID=$(date +"%b%d-%H")
75
76# Confirm configuration with user
77echo "=== Global Config ==="
78cat /sys/fs/resctrl/schemata
79echo "=== Core $1 Config ==="
80cat /sys/fs/resctrl/benchmarks/cpus_list
81cat /sys/fs/resctrl/benchmarks/schemata
82if [[ $5 == "--contend" ]]; then
83 if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then
84 echo "ERROR: thrasher binary not fonud. Exiting..."
85 exit
86 fi
87 echo "Will run 6 contending tasks"
88 runID=$runID-c
89else
90 runID=$runID-xc
91fi
92if uname -a | grep -q "mc2"; then
93 echo "MC^2 Autodetected. NOT SUPPORTED. Exiting..."
94 exit
95else
96 echo "MC^2 not detected. 50% L3 allocation enabled."
97 runID=$runID-i3
98fi
99if pwd | grep -qi dis; then
100 echo "Autodetected DIS. Will use script-level looping."
101fi
102echo "Results will be saved as $runID-$userRunID.txt"
103echo "Press enter to confirm environment, Ctrl-C to exit..."
104read
105
106# Start contending tasks
107if [[ $5 == "--contend" ]]; then
108 echo "Done. Starting 6 contending tasks..."
109 # Run two contending tasks on each other CCX
110 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
111 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
112 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
113 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
114 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
115 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
116fi
117sleep 1 # Wait for contending tasks to start
118echo "Done. Beginning benchmarks..."
119
120num_tests=$(wc -l < $tacleNames)
121for (( i = 0; i < $num_tests ; i++ ))
122do
123 # If using DIS, we have to iterate in the script as DIS won't do it for us
124 pwd | grep -qi dis
125 iters=$(python3 -c "print(int(not "$?")*("$maxJobs"-1))")
126 for ((k=0;k<=iters;k++)); do
127 # Check if we're using LITMUS^RT or not
128 if [[ -f source/extra.h ]] && grep -q "#define LITMUS 1" source/extra.h; then
129 ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1
130 else
131 # Interleave memory allocations between all nodes (only 1 node w/out MC^2)
132 chrt -r 97 numactl --interleave=all taskset -c $core ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $core $runID-$userRunID 1
133 fi
134 done
135 echo COMPLETE: ${tacleProg[$i]}
136done
137
138# End contending tasks
139if [[ $5 == "--contend" ]]; then
140 killall thrasher
141fi
142
143# Put smp_affinty back the way it was
144i=0
145for IRQ in /proc/irq/*
146do
147 if [ -d $IRQ ]; then
148 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
149 fi
150 i=$(( $i + 1 ))
151done
152