xfs: force file creation to the data device for certain layout tests
[xfstests-dev.git] / tests / perf / 001
1 #! /bin/bash
2 # SPDX-License-Identifier: GPL-2.0
3
4 #
5 # perf/001 Test
6 #
7 # Buffered random write performance test.
8 #
9 seq=`basename $0`
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
12
13 here=`pwd`
14 tmp=/tmp/$$
15 fio_config=$tmp.fio
16 fio_results=$tmp.json
17 status=1        # failure is the default!
18 trap "rm -f $tmp.*; exit \$status" 0 1 2 3 15
19
20 # get standard environment, filters and checks
21 . ./common/rc
22 . ./common/filter
23 . ./common/perf
24
25 # real QA test starts here
26 _supported_fs generic
27 _require_scratch
28 _require_block_device $SCRATCH_DEV
29 _require_fio_results
30
31 rm -f $seqres.full
32
33 _size=$((16 * $LOAD_FACTOR))
34 cat >$fio_config <<EOF
35 [t1]
36 directory=${SCRATCH_MNT}
37 allrandrepeat=1
38 readwrite=randwrite
39 size=${_size}G
40 ioengine=psync
41 end_fsync=1
42 fallocate=none
43 EOF
44
45 _require_fio $fio_config
46
47 _fio_results_init
48
49 # We are going to write at least 16gib, make sure our scratch fs is large enough
50 # to fit and not deal with any enospc overhead.
51 _size=$(($_size * 4 * 1024 * 1024))
52 _scratch_mkfs >> $seqres.full 2>&1
53 _scratch_mount
54 _require_fs_space $SCRATCH_MNT $_size
55
56 cat $fio_config >> $seqres.full
57 $FIO_PROG --output-format=json --output=$fio_results $fio_config
58
59 _scratch_unmount
60 cat $fio_results >> $seqres.full
61 _fio_results_compare $seq $fio_results
62 echo "Silence is golden"
63 status=0; exit