summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:22:08 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-17 21:30:01 -0400
commitecf6547fdce39b3ec0f333c9b391b0f1c25deba5 (patch)
treec6f25afe348be22172bed024ffe8881323e74aaf
parent1120161286ee5c855b630bccc9e0b37bb8a3ee65 (diff)
All the DIS runner scripts as used for the (rejected) RTSS'20 submission
DANGER! There's an inconsistency in the input files used for the all-pairs tests and those used for the baseline tests. Baselines: run_all_dis.sh calls run_dis.sh to do all baselines. All-pairs: Uses old TACLe script (not included here). Cache allocation 2nd-order effects on SMT friendliness: run_pair_convexity.sh
-rw-r--r--.gitignore2
-rwxr-xr-xdis/bin/field_2mb2
-rwxr-xr-xdis/bin/matrix_2mb2
-rwxr-xr-xdis/bin/neighborhood_2mb2
-rwxr-xr-xdis/bin/pointer_2mb2
-rwxr-xr-xdis/bin/transitive_2mb2
-rwxr-xr-xdis/bin/update_2mb2
l---------dis/inputs/Field/in01
l---------dis/inputs/Matrix/in01
l---------dis/inputs/Neighborhood/in01
-rw-r--r--dis/inputs/Pointer/in03
l---------dis/inputs/Transitive/in01
l---------dis/inputs/Update/in01
-rw-r--r--dis/inputs/WSSS_maxstride2mb15
-rw-r--r--dis/inputs/caches_all17
-rwxr-xr-xdis/run_all_dis.sh70
-rwxr-xr-xdis/run_dis.sh35
-rw-r--r--dis/run_pair_convexity.sh184
-rwxr-xr-xdis/setup_mem_and_global.sh19
-rwxr-xr-xsmt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh175
20 files changed, 520 insertions, 17 deletions
diff --git a/.gitignore b/.gitignore
index 24a4e1f..1824f51 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,8 @@
1# Ignore benchmark results 1# Ignore benchmark results
2*.txt 2*.txt
3*.txt.clean 3*.txt.clean
4# But not benchmark lists
5!*Names.txt
4 6
5# Ignore DIS benchmark binaries 7# Ignore DIS benchmark binaries
6**/field 8**/field
diff --git a/dis/bin/field_2mb b/dis/bin/field_2mb
new file mode 100755
index 0000000..31f2a8d
--- /dev/null
+++ b/dis/bin/field_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py field inputs/Field/in0 2097152 | ./field $@
diff --git a/dis/bin/matrix_2mb b/dis/bin/matrix_2mb
new file mode 100755
index 0000000..72710ab
--- /dev/null
+++ b/dis/bin/matrix_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py matrix inputs/Matrix/in4 2097152 | ./matrix $@ > /dev/null
diff --git a/dis/bin/neighborhood_2mb b/dis/bin/neighborhood_2mb
new file mode 100755
index 0000000..226bd98
--- /dev/null
+++ b/dis/bin/neighborhood_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py neighborhood inputs/Neighborhood/in0 2097152 | ./neighborhood $@ > /dev/null
diff --git a/dis/bin/pointer_2mb b/dis/bin/pointer_2mb
new file mode 100755
index 0000000..3ce8f2b
--- /dev/null
+++ b/dis/bin/pointer_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py pointer inputs/Pointer/in0 2097152 | ./pointer $@
diff --git a/dis/bin/transitive_2mb b/dis/bin/transitive_2mb
new file mode 100755
index 0000000..b8bcf5a
--- /dev/null
+++ b/dis/bin/transitive_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py transitive inputs/Transitive/in0 2097152 | ./transitive $@
diff --git a/dis/bin/update_2mb b/dis/bin/update_2mb
new file mode 100755
index 0000000..3bc33f4
--- /dev/null
+++ b/dis/bin/update_2mb
@@ -0,0 +1,2 @@
1#!/bin/bash
2taskset -c 0 ./gen_input.py update inputs/Update/in0 2097152 | ./update $@
diff --git a/dis/inputs/Field/in0 b/dis/inputs/Field/in0
new file mode 120000
index 0000000..2f8d436
--- /dev/null
+++ b/dis/inputs/Field/in0
@@ -0,0 +1 @@
in1 \ No newline at end of file
diff --git a/dis/inputs/Matrix/in0 b/dis/inputs/Matrix/in0
new file mode 120000
index 0000000..2f8d436
--- /dev/null
+++ b/dis/inputs/Matrix/in0
@@ -0,0 +1 @@
in1 \ No newline at end of file
diff --git a/dis/inputs/Neighborhood/in0 b/dis/inputs/Neighborhood/in0
new file mode 120000
index 0000000..83ac113
--- /dev/null
+++ b/dis/inputs/Neighborhood/in0
@@ -0,0 +1 @@
test1.in \ No newline at end of file
diff --git a/dis/inputs/Pointer/in0 b/dis/inputs/Pointer/in0
new file mode 100644
index 0000000..3535667
--- /dev/null
+++ b/dis/inputs/Pointer/in0
@@ -0,0 +1,3 @@
110485770 15 12800000 -2 1
2
310 10485760 10485760
diff --git a/dis/inputs/Transitive/in0 b/dis/inputs/Transitive/in0
new file mode 120000
index 0000000..2f8d436
--- /dev/null
+++ b/dis/inputs/Transitive/in0
@@ -0,0 +1 @@
in1 \ No newline at end of file
diff --git a/dis/inputs/Update/in0 b/dis/inputs/Update/in0
new file mode 120000
index 0000000..2f8d436
--- /dev/null
+++ b/dis/inputs/Update/in0
@@ -0,0 +1 @@
in1 \ No newline at end of file
diff --git a/dis/inputs/WSSS_maxstride2mb b/dis/inputs/WSSS_maxstride2mb
new file mode 100644
index 0000000..8fdbbc4
--- /dev/null
+++ b/dis/inputs/WSSS_maxstride2mb
@@ -0,0 +1,15 @@
1262144
2524288
31048576
42097152
54194304
66291456
78388608
810485760
912582912
1014680064
1116777216
1218874368
1320971520
1423068672
1525165824
diff --git a/dis/inputs/caches_all b/dis/inputs/caches_all
new file mode 100644
index 0000000..92e936c
--- /dev/null
+++ b/dis/inputs/caches_all
@@ -0,0 +1,17 @@
1L3:0=0000;1=0000;2=0000;3=0000
2L3:0=0000;1=0000;2=0000;3=0001
3L3:0=0000;1=0000;2=0000;3=0003
4L3:0=0000;1=0000;2=0000;3=0007
5L3:0=0000;1=0000;2=0000;3=000f
6L3:0=0000;1=0000;2=0000;3=001f
7L3:0=0000;1=0000;2=0000;3=003f
8L3:0=0000;1=0000;2=0000;3=007f
9L3:0=0000;1=0000;2=0000;3=00ff
10L3:0=0000;1=0000;2=0000;3=01ff
11L3:0=0000;1=0000;2=0000;3=03ff
12L3:0=0000;1=0000;2=0000;3=07ff
13L3:0=0000;1=0000;2=0000;3=0fff
14L3:0=0000;1=0000;2=0000;3=1fff
15L3:0=0000;1=0000;2=0000;3=3fff
16L3:0=0000;1=0000;2=0000;3=7fff
17L3:0=0000;1=0000;2=0000;3=ffff
diff --git a/dis/run_all_dis.sh b/dis/run_all_dis.sh
new file mode 100755
index 0000000..5a6b6e1
--- /dev/null
+++ b/dis/run_all_dis.sh
@@ -0,0 +1,70 @@
1#!/bin/bash
2# Run baselines for all the DIS tasks
3if [ "$EUID" -ne 0 ]
4then
5 echo "You need to be root to enable cache way and interrupt isolation!"
6 exit
7fi
8
9if uname -a | grep -q "mc2"; then
10 echo "MC^2 detected! Cache isolation will be enabled"
11 iso="i"
12else
13 echo "MC^2 not detected."
14 iso="xi"
15fi
16
17datestring=$(date +"%b%d-%H")
18if ! grep -q irqaffinity /proc/cmdline; then
19 /playpen/move_interrupts_off_core15.sh
20else
21 echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor
22fi
23WSSS=WSSS_maxstride2mb
24caches=caches_all
25# Consider re-enabling this only if you're interested in exploring bandwidth effects
26#./setup_mem_and_global.sh
27if [[ $1 == "--contend" ]]; then
28 echo "Will run 6 contending tasks"
29 echo "Files will be named $datestring-<benchmark name>-c-"$iso".txt"
30 echo "Please verify the above settings. Press enter to continue..."
31 read
32 # Run two contending tasks on each other CCX
33 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
34 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
35 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
36 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
37 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
38 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
39 ./run_dis.sh 15 10 $datestring-field-c-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches
40 ./postproc.sh $datestring-field-c-$iso
41 ./run_dis.sh 15 10 $datestring-matrix-c-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches
42 ./postproc.sh $datestring-matrix-c-$iso
43 ./run_dis.sh 15 10 $datestring-neighborhood-c-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches
44 ./postproc.sh $datestring-neighborhood-c-$iso
45 ./run_dis.sh 15 10 $datestring-pointer-c-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches
46 ./postproc.sh $datestring-pointer-c-$iso
47 ./run_dis.sh 15 10 $datestring-transitive-c-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches
48 ./postproc.sh $datestring-transitive-c-$iso
49 ./run_dis.sh 15 10 $datestring-update-c-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches
50 ./postproc.sh $datestring-update-c-$iso
51 killall thrasher
52else
53 echo "Will run no contending tasks (use --contend for contending tasks)"
54 echo "Files will be named $datestring-<benchmark name>-xc-"$iso".txt"
55 echo "Please verify the above settings. Press enter to continue..."
56 read
57 killall thrasher
58 ./run_dis.sh 15 10 $datestring-field-xc-$iso Field inputs/Field/in0 inputs/$WSSS inputs/$caches
59 ./postproc.sh $datestring-field-xc-$iso
60 ./run_dis.sh 15 10 $datestring-matrix-xc-$iso Matrix inputs/Matrix/in0 inputs/$WSSS inputs/$caches
61 ./postproc.sh $datestring-matrix-xc-$iso
62 ./run_dis.sh 15 10 $datestring-neighborhood-xc-$iso Neighborhood inputs/Neighborhood/in0 inputs/$WSSS inputs/$caches
63 ./postproc.sh $datestring-neighborhood-xc-$iso
64 ./run_dis.sh 15 10 $datestring-pointer-xc-$iso Pointer inputs/Pointer/in0 inputs/$WSSS inputs/$caches
65 ./postproc.sh $datestring-pointer-xc-$iso
66 ./run_dis.sh 15 10 $datestring-transitive-xc-$iso Transitive inputs/Transitive/in0 inputs/$WSSS inputs/$caches
67 ./postproc.sh $datestring-transitive-xc-$iso
68 ./run_dis.sh 15 10 $datestring-update-xc-$iso Update inputs/Update/in0 inputs/$WSSS inputs/$caches
69 ./postproc.sh $datestring-update-xc-$iso
70fi
diff --git a/dis/run_dis.sh b/dis/run_dis.sh
index 3e82bfb..78745ec 100755
--- a/dis/run_dis.sh
+++ b/dis/run_dis.sh
@@ -4,7 +4,7 @@ core=$1
4maxJobs=$2 4maxJobs=$2
5runID=$3 5runID=$3
6benchmark=${4,} 6benchmark=${4,}
7template_input=inputs/$4/in1 7template_input=inputs/$4/in0
8wss_settings=inputs/WSSS 8wss_settings=inputs/WSSS
9cache_settings=inputs/caches 9cache_settings=inputs/caches
10 10
@@ -36,7 +36,6 @@ echo "Done. Disabling real-time throttling..."
36echo -1 > /proc/sys/kernel/sched_rt_runtime_us 36echo -1 > /proc/sys/kernel/sched_rt_runtime_us
37echo "Done. Redirecting all interrupts to core 0..." 37echo "Done. Redirecting all interrupts to core 0..."
38 38
39# TODO: Make this cleaner
40# Redirect all interrupts to core 0 39# Redirect all interrupts to core 0
41i=0 40i=0
42for IRQ in /proc/irq/* 41for IRQ in /proc/irq/*
@@ -44,27 +43,39 @@ do
44 # Skip default_smp_affinity 43 # Skip default_smp_affinity
45 if [ -d $IRQ ]; then 44 if [ -d $IRQ ]; then
46 irqList[$i]=$(cat $IRQ/smp_affinity_list) 45 irqList[$i]=$(cat $IRQ/smp_affinity_list)
47 echo 0 > $IRQ/smp_affinity_list 46 echo 0 2> /dev/null > $IRQ/smp_affinity_list
48 fi 47 fi
49 i=$(( $i + 1 )) 48 i=$(( $i + 1 ))
50done 49done
51echo "Done. Beginning benchmarks..."
52 50
53# Setup cache control group 51echo "Done. Checking for wbinvd module..."
52if [[ ! -f "/proc/wbinvd" ]]; then
53 echo "ERROR: wbinvd module not loaded. Exiting..."
54 exit
55fi
56
57# Enable L3 isolation
58echo "Done. Enabling L3 isolation..."
54mount -t resctrl resctrl /sys/fs/resctrl 59mount -t resctrl resctrl /sys/fs/resctrl
55mkdir /sys/fs/resctrl/benchmarks 60mkdir -p /sys/fs/resctrl/benchmarks
56sleep 1 # Wait a second for the group to initialize 61echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
57echo $core > /sys/fs/resctrl/benchmarks/cpus_list 62# Reset global bandwith control and remove L3 from global
63echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
64echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
65# Alloc L3 to benchmark
66echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
67echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
68echo "Done. Beginning benchmarks..."
58 69
59# Execute the benchmark for each WSS and cache config 70# Execute the benchmark for each WSS and cache config
60while read j; do 71while read j; do
61 echo $j > /sys/fs/resctrl/benchmarks/schemata 72 echo $j > /sys/fs/resctrl/benchmarks/schemata
62 while read i; do 73 while read i; do
63 if grep -q "#define LITMUS 1" ../../baseline/source/extra.h; then 74 if grep -q "#define LITMUS 1" ../baseline/source/extra.h; then
64 echo "Using LITMUS-RT!" 75 echo "Using LITMUS-RT!"
65 ./gen_input.py $benchmark $template_input $i | ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 76 ./gen_input.py $benchmark $template_input $i | numactl -m 0 ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
66 else 77 else
67 ./gen_input.py $benchmark $template_input $i | chrt -r 97 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1 78 ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
68 fi 79 fi
69 done < $wss_settings 80 done < $wss_settings
70done < $cache_settings 81done < $cache_settings
@@ -74,7 +85,7 @@ i=0
74for IRQ in /proc/irq/* 85for IRQ in /proc/irq/*
75do 86do
76 if [ -d $IRQ ]; then 87 if [ -d $IRQ ]; then
77 echo ${irqList[$i]} > $IRQ/smp_affinity_list 88 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
78 fi 89 fi
79 i=$(( $i + 1 )) 90 i=$(( $i + 1 ))
80done 91done
diff --git a/dis/run_pair_convexity.sh b/dis/run_pair_convexity.sh
new file mode 100644
index 0000000..a4e204f
--- /dev/null
+++ b/dis/run_pair_convexity.sh
@@ -0,0 +1,184 @@
1#!/bin/bash
2
3firstCore=$1
4secondCore=$2
5maxJobs=$3
6userRunID=$4
7#template_input=$9
8tacleNames=tacleNames.txt
9
10if [ $# -lt 7 ]; then
11 echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [bench names file] [WSS setings] [cache settings] [--contend]" # [input file]"
12 exit
13fi
14
15if [ $# -gt 4 ]; then
16 echo "Using list of benchmarks from $5"
17 tacleNames=$5
18fi
19
20if [ $# -gt 5 ]; then
21 echo "Using WSS settings from $6"
22 wss_settings=$6
23fi
24
25if [ $# -gt 6 ]; then
26 echo "Using cache settings from $7"
27 cache_settings=$7
28fi
29#echo "Using template input from $9"
30
31if [ "$EUID" -ne 0 ]
32then
33 echo "You need to be root to enable interrupt isolation and real-time execution!"
34 exit
35fi
36
37echo "Making sure that binaries are up to date..."
38while read i; do
39 make bin/$i
40done < $tacleNames
41echo "Done. Disabling real-time throttling..."
42
43# Turn off rt throttling
44echo -1 > /proc/sys/kernel/sched_rt_runtime_us
45echo "Done. Redirecting all interrupts to core 0..."
46
47# Redirect all interrupts to core 0
48i=0
49for IRQ in /proc/irq/*
50do
51 # Skip default_smp_affinity
52 if [ -d $IRQ ]; then
53 irqList[$i]=$(cat $IRQ/smp_affinity_list)
54 echo 0 2> /dev/null > $IRQ/smp_affinity_list
55 fi
56 i=$(( $i + 1 ))
57done
58
59# Read the names of each benchmark
60j=0
61while read i; do
62 tacleProg[$j]=$i
63 j=$(( $j + 1 ))
64done < $tacleNames
65
66echo "Done. Checking for wbinvd module..."
67if [[ ! -f "/proc/wbinvd" ]]; then
68 echo "ERROR: wbinvd module not loaded. Exiting..."
69 exit
70fi
71
72echo "Done. Setting cores $firstCore and $secondCore to 'performance'..."
73echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor
74echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governor
75
76# Enable L3 isolation
77echo "Done. Enabling L3 isolation..."
78mount -t resctrl resctrl /sys/fs/resctrl
79mkdir -p /sys/fs/resctrl/benchmarks
80mkdir -p /sys/fs/resctrl/benchmarks2
81echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list
82echo $secondCore > /sys/fs/resctrl/benchmarks2/cpus_list
83# Reset global bandwith control and remove L3 from global
84echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
85echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
86# Alloc L3 to benchmark
87echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
88echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks2/schemata
89echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
90echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks2/schemata
91echo "Done. Verifying configuration with user..."
92
93# Generate file name string
94# We append to this as we parse the environment settings
95runID=$(date +"%b%d-%H")
96
97# Confirm configuration with user
98echo "=== Global Config ==="
99cat /sys/fs/resctrl/schemata
100echo "=== Core $firstCore and $secondCore Config ==="
101cat /sys/fs/resctrl/benchmarks/schemata
102if [[ $8 == "--contend" ]]; then
103 if [[ ! -f "/playpen/mc2/imx6q-thrasher/thrasher" ]]; then
104 echo "ERROR: thrasher binary not fonud. Exiting..."
105 exit
106 fi
107 echo "Will run 6 contending tasks"
108 runID=$runID-c
109else
110 runID=$runID-xc
111fi
112if uname -a | grep -q "mc2"; then
113 echo "MC^2 Autodetected. Cache coloring will be enabled."
114 runID=$runID-i
115else
116 echo "MC^2 not detected. This benchmark requires MC^2! Exiting..."
117 exit
118fi
119echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt"
120echo "Press enter to confirm environment, Ctrl-C to exit..."
121read
122
123# Start contending tasks
124if [[ $8 == "--contend" ]]; then
125 echo "Done. Starting 6 contending tasks..."
126 # Run two contending tasks on each other CCX
127 taskset -c 1 /playpen/mc2/imx6q-thrasher/thrasher &
128 taskset -c 2 /playpen/mc2/imx6q-thrasher/thrasher &
129 taskset -c 5 /playpen/mc2/imx6q-thrasher/thrasher &
130 taskset -c 6 /playpen/mc2/imx6q-thrasher/thrasher &
131 taskset -c 9 /playpen/mc2/imx6q-thrasher/thrasher &
132 taskset -c 10 /playpen/mc2/imx6q-thrasher/thrasher &
133fi
134sleep 1 # Wait for contending tasks to start
135echo "Done. Beginning benchmarks..."
136
137num_tests=$(wc -l < $tacleNames)
138for (( ii = 0; ii < $num_tests ; ii++ ))
139do
140 for (( jj = $ii+1; jj < $num_tests ; jj++ )) #loop through programs
141 do
142# Execute the benchmark for each WSS and cache config
143while read k; do
144 echo $k > /sys/fs/resctrl/benchmarks/schemata
145 while read j; do
146 echo $j > /sys/fs/resctrl/benchmarks2/schemata
147 while read i; do
148 ./gen_input.py matrix inputs/Matrix/in0 $i | chrt -r 97 numactl -m 0 taskset -c $firstCore ./${tacleProg[$ii]} ${tacleProg[$ii]}-$i-$k $maxJobs $firstCore $secondCore ${tacleProg[$jj]}-$i-$j $runID-$userRunID-A 1 > /dev/null & PID1=$!;
149 ./gen_input.py transitive inputs/Transitive/in0 $i | chrt -r 97 numactl -m 1 taskset -c $secondCore ./${tacleProg[$jj]} ${tacleProg[$jj]}-$i-$j $maxJobs $secondCore $firstCore ${tacleProg[$ii]}-$i-$k $runID-$userRunID-B 2 > /dev/null & PID2=$!;
150 wait $PID1 $PID2
151 done < $wss_settings
152 echo "Done with $k $j"
153 done < $cache_settings
154done < $cache_settings
155
156# ./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
157# chrt -r 97 numactl -m 0 taskset -c $firstCore ./bin/${tacleProg[$i]} ${tacleProg[$i]} $maxJobs $firstCore $secondCore ${tacleProg[$j]} $runID-$userRunID"-A" 1 & PID1=$!;
158# chrt -r 97 numactl -m 1 taskset -c $secondCore ./bin/${tacleProg[$j]} ${tacleProg[$j]} $maxJobs $secondCore $firstCore ${tacleProg[$i]} $runID-$userRunID"-B" 2 & PID2=$!;
159# wait $PID1 $PID2
160 echo ${tacleProg[$i]} ${tacleProg[$j]}
161 done
162 echo COMPLETE: ${tacleProg[$i]}
163done
164
165# End contending tasks
166if [[ $8 == "--contend" ]]; then
167 killall thrasher
168fi
169
170# Remove semaphores from system
171# Leaving them won't hurt these tests, but would be messy and is bad practice
172# TODO: Do this directly in the benchmarks. They should clean up after themselves
173./bin/cleanupSemaphores
174
175# Put smp_affinty back the way it was
176i=0
177for IRQ in /proc/irq/*
178do
179 if [ -d $IRQ ]; then
180 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
181 fi
182 i=$(( $i + 1 ))
183done
184
diff --git a/dis/setup_mem_and_global.sh b/dis/setup_mem_and_global.sh
index 56d6219..6bddb2f 100755
--- a/dis/setup_mem_and_global.sh
+++ b/dis/setup_mem_and_global.sh
@@ -1,13 +1,22 @@
1# Setup group 1# Setup group
2mount -t resctrl resctrl /sys/fs/resctrl
2mkdir -p /sys/fs/resctrl/benchmarks 3mkdir -p /sys/fs/resctrl/benchmarks
3echo 15 > /sys/fs/resctrl/benchmarks/cpus_list 4echo 15 > /sys/fs/resctrl/benchmarks/cpus_list
4# Remove mem from global domain 5echo 31 > /sys/fs/resctrl/benchmarks/cpus_list
6# Remove mem from global domain and assign to local
5echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata 7echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
6# Remove bandwidth from global domain 8echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
7echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata 9if [[ $1 == "--bandwith" ]]; then
8echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata 10 # Remove bandwidth from global domain
11 echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata
12 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
13else
14 # Disable bandwidth control
15 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
16 echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
17fi
9echo "=== Global Config ===" 18echo "=== Global Config ==="
10cat /sys/fs/resctrl/schemata 19cat /sys/fs/resctrl/schemata
11echo "=== Core 15 Config ===" 20echo "=== Core 15 & 31 Config ==="
12cat /sys/fs/resctrl/benchmarks/schemata 21cat /sys/fs/resctrl/benchmarks/schemata
13 22
diff --git a/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh b/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh
new file mode 100755
index 0000000..2ac3fc1
--- /dev/null
+++ b/smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh
@@ -0,0 +1,175 @@
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-DIS.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 # Get DIS to loop continuously in the background by infinite restarts
126 if uname -a | grep -q "mc2"; then
127 bash -c "while true; do chrt -r 97 numactl --interleave=all taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!;
128 else
129 bash -c "while true; do chrt -r 97 taskset -c $firstCore ./bin/${tacleProg[$i]} NULL -1 $firstCore NULL 0 &> /dev/null; done" & PID1=$!;
130 fi
131 # Each sample runs in its own process
132 for ((k=0;k<=maxJobs;k++)); do
133 if uname -a | grep -q "mc2"; then
134 chrt -r 97 numactl --interleave=all taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!;
135 else
136 chrt -r 97 taskset -c $secondCore ./bin/${tacleProg[$i]} ${tacleProg[$i]}"+"${tacleProg[$j]} $maxJobs $secondCore $runID-$userRunID-LC-DIS 1 & PID2=$!;
137 fi
138 done
139 # The paired task runs continuously in this configuration, so we have
140 # to kill it once the task that we're measuring finishes.
141 wait $PID2
142 kill $PID1
143 # Killing bash will not kill its children by default - work aronud that here
144 killall transitive &> /dev/null
145 killall matrix &> /dev/null
146 killall pointer &> /dev/null
147 killall field &> /dev/null
148 killall neighborhood &> /dev/null
149 killall update &> /dev/null
150 killall gen_input.py &> /dev/null
151 echo ${tacleProg[$i]} ${tacleProg[$j]}
152 done
153 echo COMPLETE: ${tacleProg[$i]}
154done
155
156# End contending tasks
157if [[ $6 == "--contend" ]]; then
158 killall thrasher
159fi
160
161# Remove semaphores from system
162# Leaving them won't hurt these tests, but would be messy and is bad practice
163# TODO: Do this directly in the benchmarks. They should clean up after themselves
164./bin/cleanupSemaphores
165
166# Put smp_affinty back the way it was
167i=0
168for IRQ in /proc/irq/*
169do
170 if [ -d $IRQ ]; then
171 echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
172 fi
173 i=$(( $i + 1 ))
174done
175