blob: 78745ec119fd2641d22599ba65c81095aca3d67b (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
#!/bin/bash
core=$1
maxJobs=$2
runID=$3
benchmark=${4,}
template_input=inputs/$4/in0
wss_settings=inputs/WSSS
cache_settings=inputs/caches
if [ $# -lt 4 ]; then
echo "Usage $0 <core ID> <number of iterations> <run ID> <benchmark> [template input] [DIS WSS file] [DIS cache file]"
exit
fi
if [ $# -gt 4 ]; then
echo "Using alternate input template from $5"
template_input=$5
fi
if [ $# -gt 5 ]; then
echo "Using alternate WSS settings from $6"
wss_settings=$6
fi
if [ $# -gt 6 ]; then
echo "Using alternate cache settings from $7"
cache_settings=$7
fi
echo "Making sure that binary is up to date..."
make $benchmark
echo "Done. Disabling real-time throttling..."
# Turn off rt throttling
echo -1 > /proc/sys/kernel/sched_rt_runtime_us
echo "Done. Redirecting all interrupts to core 0..."
# Redirect all interrupts to core 0
i=0
for IRQ in /proc/irq/*
do
# Skip default_smp_affinity
if [ -d $IRQ ]; then
irqList[$i]=$(cat $IRQ/smp_affinity_list)
echo 0 2> /dev/null > $IRQ/smp_affinity_list
fi
i=$(( $i + 1 ))
done
echo "Done. Checking for wbinvd module..."
if [[ ! -f "/proc/wbinvd" ]]; then
echo "ERROR: wbinvd module not loaded. Exiting..."
exit
fi
# Enable L3 isolation
echo "Done. Enabling L3 isolation..."
mount -t resctrl resctrl /sys/fs/resctrl
mkdir -p /sys/fs/resctrl/benchmarks
echo $1 > /sys/fs/resctrl/benchmarks/cpus_list
# Reset global bandwith control and remove L3 from global
echo "L3:0=ffff;1=ffff;2=ffff;3=0000" > /sys/fs/resctrl/schemata
echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/schemata
# Alloc L3 to benchmark
echo "L3:0=0000;1=0000;2=0000;3=ffff" > /sys/fs/resctrl/benchmarks/schemata
echo "MB:0=2048;1=2048;2=2048;3=2048" > /sys/fs/resctrl/benchmarks/schemata
echo "Done. Beginning benchmarks..."
# Execute the benchmark for each WSS and cache config
while read j; do
echo $j > /sys/fs/resctrl/benchmarks/schemata
while read i; do
if grep -q "#define LITMUS 1" ../baseline/source/extra.h; then
echo "Using LITMUS-RT!"
./gen_input.py $benchmark $template_input $i | numactl -m 0 ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
else
./gen_input.py $benchmark $template_input $i | chrt -r 97 numactl -m 0 taskset -c $core ./$benchmark $benchmark-$i-$j $maxJobs $core $runID 1
fi
done < $wss_settings
done < $cache_settings
# Put IRQs back as they were
i=0
for IRQ in /proc/irq/*
do
if [ -d $IRQ ]; then
echo ${irqList[$i]} 2> /dev/null > $IRQ/smp_affinity_list
fi
i=$(( $i + 1 ))
done
|