aboutsummaryrefslogtreecommitdiffstats
path: root/case-lru-file-readtwice
blob: 85533b2486346c95a06ad2c47ea40ea856a367c2 (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
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

# flush memory with use-twice page cache reads

# lru_lock coverage
# 2060819456	activate_page
#  154664490	____pagevec_lru_add
#  131308246	move_active_pages_to_lru
#   65654100	shrink_active_list
#   65510367	shrink_inactive_list

# zone->lock coverage
#   33637385	free_pcppages_bulk
#   33650227	rmqueue_bulk

. ./hw_vars

for i in `seq 1 $nr_task`
do
	create_sparse_file $SPARSE_FILE-$i $((ROTATE_BYTES / nr_task))
	timeout --foreground -s INT ${runtime:-600} dd bs=4k if=$SPARSE_FILE-$i of=/dev/null > $TMPFS_MNT/dd-output-1-$i 2>&1 &
	timeout --foreground -s INT ${runtime:-600} dd bs=4k if=$SPARSE_FILE-$i of=/dev/null > $TMPFS_MNT/dd-output-2-$i 2>&1 &
done

wait
sleep 1

for file in $TMPFS_MNT/dd-output-*
do
	[ -s "$file" ] || {
		echo "dd output file empty: $file" >&2
	}
	cat $file
	rm  $file
done

rm `seq -f $SPARSE_FILE-%g 1 $nr_task`