summaryrefslogtreecommitdiff
path: root/examples/memcg-kernbench.load
blob: abff87e9cd2d2fb0936ed13c2373d8cd8a76897e (plain)
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
%define M /sys/fs/cgroup/memory
%define nr_memcgs 04
%define nr_jobs 8
%define limit 1G

%prepare
for x in `seq -w %{nr_memcgs}`; do rmdir %{M}/kernbench/$x || true; done
rmdir %{M}/kernbench || true
for x in `seq -w %{nr_memcgs}`; do make -s -C linux-$x mrproper defconfig & done
mkdir %{M}/kernbench
echo 1 >%{M}/kernbench/memory.use_hierarchy
echo %{limit} >%{M}/kernbench/memory.limit_in_bytes
for x in `seq -w %{nr_memcgs}`; do mkdir %{M}/kernbench/$x; done
wait

%work
for x in `seq -w %{nr_memcgs}`
do
	( echo $BASHPID >%{M}/kernbench/$x/tasks
	  make -s -j %{nr_jobs} -C linux-$x ) &
done
wait

%data memory.stat
cat %{M}/kernbench/memory.stat