diff options
| author | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 21:22:08 -0400 |
|---|---|---|
| committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-17 21:30:01 -0400 |
| commit | ecf6547fdce39b3ec0f333c9b391b0f1c25deba5 (patch) | |
| tree | c6f25afe348be22172bed024ffe8881323e74aaf | |
| parent | 1120161286ee5c855b630bccc9e0b37bb8a3ee65 (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-- | .gitignore | 2 | ||||
| -rwxr-xr-x | dis/bin/field_2mb | 2 | ||||
| -rwxr-xr-x | dis/bin/matrix_2mb | 2 | ||||
| -rwxr-xr-x | dis/bin/neighborhood_2mb | 2 | ||||
| -rwxr-xr-x | dis/bin/pointer_2mb | 2 | ||||
| -rwxr-xr-x | dis/bin/transitive_2mb | 2 | ||||
| -rwxr-xr-x | dis/bin/update_2mb | 2 | ||||
| l--------- | dis/inputs/Field/in0 | 1 | ||||
| l--------- | dis/inputs/Matrix/in0 | 1 | ||||
| l--------- | dis/inputs/Neighborhood/in0 | 1 | ||||
| -rw-r--r-- | dis/inputs/Pointer/in0 | 3 | ||||
| l--------- | dis/inputs/Transitive/in0 | 1 | ||||
| l--------- | dis/inputs/Update/in0 | 1 | ||||
| -rw-r--r-- | dis/inputs/WSSS_maxstride2mb | 15 | ||||
| -rw-r--r-- | dis/inputs/caches_all | 17 | ||||
| -rwxr-xr-x | dis/run_all_dis.sh | 70 | ||||
| -rwxr-xr-x | dis/run_dis.sh | 35 | ||||
| -rw-r--r-- | dis/run_pair_convexity.sh | 184 | ||||
| -rwxr-xr-x | dis/setup_mem_and_global.sh | 19 | ||||
| -rwxr-xr-x | smt_analysis_rtss20/run_all_pairs_Level-C_DIS.sh | 175 |
20 files changed, 520 insertions, 17 deletions
| @@ -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 | ||
| 2 | taskset -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 | ||
| 2 | taskset -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 | ||
| 2 | taskset -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 | ||
| 2 | taskset -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 | ||
| 2 | taskset -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 | ||
| 2 | taskset -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 @@ | |||
| 1 | 10485770 15 12800000 -2 1 | ||
| 2 | |||
| 3 | 10 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 @@ | |||
| 1 | 262144 | ||
| 2 | 524288 | ||
| 3 | 1048576 | ||
| 4 | 2097152 | ||
| 5 | 4194304 | ||
| 6 | 6291456 | ||
| 7 | 8388608 | ||
| 8 | 10485760 | ||
| 9 | 12582912 | ||
| 10 | 14680064 | ||
| 11 | 16777216 | ||
| 12 | 18874368 | ||
| 13 | 20971520 | ||
| 14 | 23068672 | ||
| 15 | 25165824 | ||
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 @@ | |||
| 1 | L3:0=0000;1=0000;2=0000;3=0000 | ||
| 2 | L3:0=0000;1=0000;2=0000;3=0001 | ||
| 3 | L3:0=0000;1=0000;2=0000;3=0003 | ||
| 4 | L3:0=0000;1=0000;2=0000;3=0007 | ||
| 5 | L3:0=0000;1=0000;2=0000;3=000f | ||
| 6 | L3:0=0000;1=0000;2=0000;3=001f | ||
| 7 | L3:0=0000;1=0000;2=0000;3=003f | ||
| 8 | L3:0=0000;1=0000;2=0000;3=007f | ||
| 9 | L3:0=0000;1=0000;2=0000;3=00ff | ||
| 10 | L3:0=0000;1=0000;2=0000;3=01ff | ||
| 11 | L3:0=0000;1=0000;2=0000;3=03ff | ||
| 12 | L3:0=0000;1=0000;2=0000;3=07ff | ||
| 13 | L3:0=0000;1=0000;2=0000;3=0fff | ||
| 14 | L3:0=0000;1=0000;2=0000;3=1fff | ||
| 15 | L3:0=0000;1=0000;2=0000;3=3fff | ||
| 16 | L3:0=0000;1=0000;2=0000;3=7fff | ||
| 17 | L3: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 | ||
| 3 | if [ "$EUID" -ne 0 ] | ||
| 4 | then | ||
| 5 | echo "You need to be root to enable cache way and interrupt isolation!" | ||
| 6 | exit | ||
| 7 | fi | ||
| 8 | |||
| 9 | if uname -a | grep -q "mc2"; then | ||
| 10 | echo "MC^2 detected! Cache isolation will be enabled" | ||
| 11 | iso="i" | ||
| 12 | else | ||
| 13 | echo "MC^2 not detected." | ||
| 14 | iso="xi" | ||
| 15 | fi | ||
| 16 | |||
| 17 | datestring=$(date +"%b%d-%H") | ||
| 18 | if ! grep -q irqaffinity /proc/cmdline; then | ||
| 19 | /playpen/move_interrupts_off_core15.sh | ||
| 20 | else | ||
| 21 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
| 22 | fi | ||
| 23 | WSSS=WSSS_maxstride2mb | ||
| 24 | caches=caches_all | ||
| 25 | # Consider re-enabling this only if you're interested in exploring bandwidth effects | ||
| 26 | #./setup_mem_and_global.sh | ||
| 27 | if [[ $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 | ||
| 52 | else | ||
| 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 | ||
| 70 | fi | ||
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 | |||
| 4 | maxJobs=$2 | 4 | maxJobs=$2 |
| 5 | runID=$3 | 5 | runID=$3 |
| 6 | benchmark=${4,} | 6 | benchmark=${4,} |
| 7 | template_input=inputs/$4/in1 | 7 | template_input=inputs/$4/in0 |
| 8 | wss_settings=inputs/WSSS | 8 | wss_settings=inputs/WSSS |
| 9 | cache_settings=inputs/caches | 9 | cache_settings=inputs/caches |
| 10 | 10 | ||
| @@ -36,7 +36,6 @@ echo "Done. Disabling real-time throttling..." | |||
| 36 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | 36 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us |
| 37 | echo "Done. Redirecting all interrupts to core 0..." | 37 | echo "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 |
| 41 | i=0 | 40 | i=0 |
| 42 | for IRQ in /proc/irq/* | 41 | for 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 )) |
| 50 | done | 49 | done |
| 51 | echo "Done. Beginning benchmarks..." | ||
| 52 | 50 | ||
| 53 | # Setup cache control group | 51 | echo "Done. Checking for wbinvd module..." |
| 52 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 53 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 54 | exit | ||
| 55 | fi | ||
| 56 | |||
| 57 | # Enable L3 isolation | ||
| 58 | echo "Done. Enabling L3 isolation..." | ||
| 54 | mount -t resctrl resctrl /sys/fs/resctrl | 59 | mount -t resctrl resctrl /sys/fs/resctrl |
| 55 | mkdir /sys/fs/resctrl/benchmarks | 60 | mkdir -p /sys/fs/resctrl/benchmarks |
| 56 | sleep 1 # Wait a second for the group to initialize | 61 | echo $1 > /sys/fs/resctrl/benchmarks/cpus_list |
| 57 | echo $core > /sys/fs/resctrl/benchmarks/cpus_list | 62 | # Reset global bandwith control and remove L3 from global |
| 63 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 64 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 65 | # Alloc L3 to benchmark | ||
| 66 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 67 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 68 | echo "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 |
| 60 | while read j; do | 71 | while 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 |
| 70 | done < $cache_settings | 81 | done < $cache_settings |
| @@ -74,7 +85,7 @@ i=0 | |||
| 74 | for IRQ in /proc/irq/* | 85 | for IRQ in /proc/irq/* |
| 75 | do | 86 | do |
| 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 )) |
| 80 | done | 91 | done |
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 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | #template_input=$9 | ||
| 8 | tacleNames=tacleNames.txt | ||
| 9 | |||
| 10 | if [ $# -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 | ||
| 13 | fi | ||
| 14 | |||
| 15 | if [ $# -gt 4 ]; then | ||
| 16 | echo "Using list of benchmarks from $5" | ||
| 17 | tacleNames=$5 | ||
| 18 | fi | ||
| 19 | |||
| 20 | if [ $# -gt 5 ]; then | ||
| 21 | echo "Using WSS settings from $6" | ||
| 22 | wss_settings=$6 | ||
| 23 | fi | ||
| 24 | |||
| 25 | if [ $# -gt 6 ]; then | ||
| 26 | echo "Using cache settings from $7" | ||
| 27 | cache_settings=$7 | ||
| 28 | fi | ||
| 29 | #echo "Using template input from $9" | ||
| 30 | |||
| 31 | if [ "$EUID" -ne 0 ] | ||
| 32 | then | ||
| 33 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 34 | exit | ||
| 35 | fi | ||
| 36 | |||
| 37 | echo "Making sure that binaries are up to date..." | ||
| 38 | while read i; do | ||
| 39 | make bin/$i | ||
| 40 | done < $tacleNames | ||
| 41 | echo "Done. Disabling real-time throttling..." | ||
| 42 | |||
| 43 | # Turn off rt throttling | ||
| 44 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 45 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 46 | |||
| 47 | # Redirect all interrupts to core 0 | ||
| 48 | i=0 | ||
| 49 | for IRQ in /proc/irq/* | ||
| 50 | do | ||
| 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 )) | ||
| 57 | done | ||
| 58 | |||
| 59 | # Read the names of each benchmark | ||
| 60 | j=0 | ||
| 61 | while read i; do | ||
| 62 | tacleProg[$j]=$i | ||
| 63 | j=$(( $j + 1 )) | ||
| 64 | done < $tacleNames | ||
| 65 | |||
| 66 | echo "Done. Checking for wbinvd module..." | ||
| 67 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 68 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 69 | exit | ||
| 70 | fi | ||
| 71 | |||
| 72 | echo "Done. Setting cores $firstCore and $secondCore to 'performance'..." | ||
| 73 | echo "performance" > /sys/devices/system/cpu/cpu15/cpufreq/scaling_governor | ||
| 74 | echo "performance" > /sys/devices/system/cpu/cpu31/cpufreq/scaling_governor | ||
| 75 | |||
| 76 | # Enable L3 isolation | ||
| 77 | echo "Done. Enabling L3 isolation..." | ||
| 78 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 79 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 80 | mkdir -p /sys/fs/resctrl/benchmarks2 | ||
| 81 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 82 | echo $secondCore > /sys/fs/resctrl/benchmarks2/cpus_list | ||
| 83 | # Reset global bandwith control and remove L3 from global | ||
| 84 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 85 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 86 | # Alloc L3 to benchmark | ||
| 87 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 88 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks2/schemata | ||
| 89 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 90 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks2/schemata | ||
| 91 | echo "Done. Verifying configuration with user..." | ||
| 92 | |||
| 93 | # Generate file name string | ||
| 94 | # We append to this as we parse the environment settings | ||
| 95 | runID=$(date +"%b%d-%H") | ||
| 96 | |||
| 97 | # Confirm configuration with user | ||
| 98 | echo "=== Global Config ===" | ||
| 99 | cat /sys/fs/resctrl/schemata | ||
| 100 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 101 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 102 | if [[ $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 | ||
| 109 | else | ||
| 110 | runID=$runID-xc | ||
| 111 | fi | ||
| 112 | if uname -a | grep -q "mc2"; then | ||
| 113 | echo "MC^2 Autodetected. Cache coloring will be enabled." | ||
| 114 | runID=$runID-i | ||
| 115 | else | ||
| 116 | echo "MC^2 not detected. This benchmark requires MC^2! Exiting..." | ||
| 117 | exit | ||
| 118 | fi | ||
| 119 | echo "Results will be saved as $runID-$userRunID-A.txt and $runID-$userRunID-B.txt" | ||
| 120 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 121 | read | ||
| 122 | |||
| 123 | # Start contending tasks | ||
| 124 | if [[ $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 & | ||
| 133 | fi | ||
| 134 | sleep 1 # Wait for contending tasks to start | ||
| 135 | echo "Done. Beginning benchmarks..." | ||
| 136 | |||
| 137 | num_tests=$(wc -l < $tacleNames) | ||
| 138 | for (( ii = 0; ii < $num_tests ; ii++ )) | ||
| 139 | do | ||
| 140 | for (( jj = $ii+1; jj < $num_tests ; jj++ )) #loop through programs | ||
| 141 | do | ||
| 142 | # Execute the benchmark for each WSS and cache config | ||
| 143 | while 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 | ||
| 154 | done < $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]} | ||
| 163 | done | ||
| 164 | |||
| 165 | # End contending tasks | ||
| 166 | if [[ $8 == "--contend" ]]; then | ||
| 167 | killall thrasher | ||
| 168 | fi | ||
| 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 | ||
| 176 | i=0 | ||
| 177 | for IRQ in /proc/irq/* | ||
| 178 | do | ||
| 179 | if [ -d $IRQ ]; then | ||
| 180 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 181 | fi | ||
| 182 | i=$(( $i + 1 )) | ||
| 183 | done | ||
| 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 |
| 2 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 2 | mkdir -p /sys/fs/resctrl/benchmarks | 3 | mkdir -p /sys/fs/resctrl/benchmarks |
| 3 | echo 15 > /sys/fs/resctrl/benchmarks/cpus_list | 4 | echo 15 > /sys/fs/resctrl/benchmarks/cpus_list |
| 4 | # Remove mem from global domain | 5 | echo 31 > /sys/fs/resctrl/benchmarks/cpus_list |
| 6 | # Remove mem from global domain and assign to local | ||
| 5 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | 7 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata |
| 6 | # Remove bandwidth from global domain | 8 | echo "L3:0=ffff;1=ffff;2=ffff;3=ffff" > /sys/fs/resctrl/benchmarks/schemata |
| 7 | echo "MB:0=2;1=2;2=2;3=2" > /sys/fs/resctrl/schemata | 9 | if [[ $1 == "--bandwith" ]]; then |
| 8 | echo "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 | ||
| 13 | else | ||
| 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 | ||
| 17 | fi | ||
| 9 | echo "=== Global Config ===" | 18 | echo "=== Global Config ===" |
| 10 | cat /sys/fs/resctrl/schemata | 19 | cat /sys/fs/resctrl/schemata |
| 11 | echo "=== Core 15 Config ===" | 20 | echo "=== Core 15 & 31 Config ===" |
| 12 | cat /sys/fs/resctrl/benchmarks/schemata | 21 | cat /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 | |||
| 3 | firstCore=$1 | ||
| 4 | secondCore=$2 | ||
| 5 | maxJobs=$3 | ||
| 6 | userRunID=$4 | ||
| 7 | tacleNames=tacleNames.txt | ||
| 8 | |||
| 9 | if [ $# -lt 4 ]; then | ||
| 10 | echo "Usage $0 <first core ID> <second core ID> <number of iterations> <run ID> [TACLe names file] [--contend]" | ||
| 11 | exit | ||
| 12 | fi | ||
| 13 | |||
| 14 | if [ $# -gt 4 ]; then | ||
| 15 | echo "Using alternate list of TACLe benchmarks from $5" | ||
| 16 | tacleNames=$5 | ||
| 17 | fi | ||
| 18 | |||
| 19 | if [ "$EUID" -ne 0 ] | ||
| 20 | then | ||
| 21 | echo "You need to be root to enable interrupt isolation and real-time execution!" | ||
| 22 | exit | ||
| 23 | fi | ||
| 24 | |||
| 25 | echo "Making sure that binaries are up to date..." | ||
| 26 | while read i; do | ||
| 27 | make bin/$i | ||
| 28 | done < $tacleNames | ||
| 29 | echo "Done. Disabling real-time throttling..." | ||
| 30 | |||
| 31 | # Turn off rt throttling | ||
| 32 | echo -1 > /proc/sys/kernel/sched_rt_runtime_us | ||
| 33 | echo "Done. Redirecting all interrupts to core 0..." | ||
| 34 | |||
| 35 | # Redirect all interrupts to core 0 | ||
| 36 | i=0 | ||
| 37 | for IRQ in /proc/irq/* | ||
| 38 | do | ||
| 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 )) | ||
| 45 | done | ||
| 46 | |||
| 47 | # Read the names of each benchmark | ||
| 48 | j=0 | ||
| 49 | while read i; do | ||
| 50 | tacleProg[$j]=$i | ||
| 51 | j=$(( $j + 1 )) | ||
| 52 | done < $tacleNames | ||
| 53 | |||
| 54 | echo "Done. Checking for wbinvd module..." | ||
| 55 | if [[ ! -f "/proc/wbinvd" ]]; then | ||
| 56 | echo "ERROR: wbinvd module not loaded. Exiting..." | ||
| 57 | exit | ||
| 58 | fi | ||
| 59 | |||
| 60 | # Enable L3 isolation | ||
| 61 | echo "Done. Enabling L3 isolation..." | ||
| 62 | mount -t resctrl resctrl /sys/fs/resctrl | ||
| 63 | mkdir -p /sys/fs/resctrl/benchmarks | ||
| 64 | echo $firstCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 65 | echo $secondCore > /sys/fs/resctrl/benchmarks/cpus_list | ||
| 66 | # Reset global bandwith control and remove L3 from global | ||
| 67 | echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata | ||
| 68 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata | ||
| 69 | # Alloc L3 to benchmark | ||
| 70 | echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata | ||
| 71 | echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata | ||
| 72 | echo "Done. Verifying configuration with user..." | ||
| 73 | |||
| 74 | # Generate file name string | ||
| 75 | # We append to this as we parse the environment settings | ||
| 76 | runID=$(date +"%b%d-%H") | ||
| 77 | |||
| 78 | # Confirm configuration with user | ||
| 79 | echo "=== Global Config ===" | ||
| 80 | cat /sys/fs/resctrl/schemata | ||
| 81 | echo "=== Core $firstCore and $secondCore Config ===" | ||
| 82 | cat /sys/fs/resctrl/benchmarks/schemata | ||
| 83 | if [[ $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 | ||
| 90 | else | ||
| 91 | runID=$runID-xc | ||
| 92 | fi | ||
| 93 | if uname -a | grep -q "mc2"; then | ||
| 94 | echo "MC^2 Autodetected. Cache coloring will be DISABLED." | ||
| 95 | runID=$runID-i | ||
| 96 | else | ||
| 97 | echo "MC^2 not detected. Cache coloring will be DISABLED." | ||
| 98 | runID=$runID-xi | ||
| 99 | fi | ||
| 100 | echo "Results will be saved as $runID-$userRunID-LC-DIS.txt" | ||
| 101 | echo "Press enter to confirm environment, Ctrl-C to exit..." | ||
| 102 | read | ||
| 103 | |||
| 104 | # Start contending tasks | ||
| 105 | if [[ $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 & | ||
| 114 | fi | ||
| 115 | sleep 1 # Wait for contending tasks to start | ||
| 116 | echo "Done. Beginning benchmarks..." | ||
| 117 | |||
| 118 | num_tests=$(wc -l < $tacleNames) | ||
| 119 | for (( i = 0; i < $num_tests ; i++ )) | ||
| 120 | do | ||
| 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]} | ||
| 154 | done | ||
| 155 | |||
| 156 | # End contending tasks | ||
| 157 | if [[ $6 == "--contend" ]]; then | ||
| 158 | killall thrasher | ||
| 159 | fi | ||
| 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 | ||
| 167 | i=0 | ||
| 168 | for IRQ in /proc/irq/* | ||
| 169 | do | ||
| 170 | if [ -d $IRQ ]; then | ||
| 171 | echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list | ||
| 172 | fi | ||
| 173 | i=$(( $i + 1 )) | ||
| 174 | done | ||
| 175 | |||
