summaryrefslogtreecommitdiff
path: root/tests/generic/095
blob: c4693917b3e149e2c3ff1e18bf42c5d85c18f671 (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
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
# Copyright (c) 2015 Red Hat Inc. All Rights Reserved.
#
# FS QA Test generic/095
#
# Concurrent mixed I/O (buffer I/O, aiodio, mmap, splice) on the same files
#
. ./common/preamble
_begin_fstest auto rw stress

# Import common functions.
. ./common/filter

# real QA test starts here
_supported_fs generic
_require_scratch
_require_odirect
_require_aio

iodepth=$((16 * LOAD_FACTOR))
iodepth_batch=$((8 * LOAD_FACTOR))
numjobs=$((5 * LOAD_FACTOR))
fio_config=$tmp.fio
fio_out=$tmp.fio.out
cat >$fio_config <<EOF
[global]
bs=8k
iodepth=$iodepth
iodepth_batch=$iodepth_batch
randrepeat=1
size=1m
directory=$SCRATCH_MNT
numjobs=$numjobs
[job1]
ioengine=sync
bs=1k
direct=1
rw=randread
filename=file1:file2
[job2]
ioengine=libaio
rw=randwrite
direct=1
filename=file1:file2
[job3]
bs=1k
ioengine=posixaio
rw=randwrite
direct=1
filename=file1:file2
[job4]
ioengine=splice
direct=1
rw=randwrite
filename=file1:file2
[job5]
bs=1k
ioengine=sync
rw=randread
filename=file1:file2
[job6]
ioengine=posixaio
rw=randwrite
filename=file1:file2
[job7]
ioengine=splice
rw=randwrite
filename=file1:file2
[job8]
ioengine=mmap
rw=randwrite
bs=1k
filename=file1:file2
[job9]
ioengine=mmap
rw=randwrite
direct=1
filename=file1:file2
EOF
# with ioengine=mmap and direct=1, fio requires bs to be at least pagesize,
# which is a fio built-in var.
echo 'bs=$pagesize' >> $fio_config

_require_fio $fio_config
_scratch_mkfs >>$seqres.full 2>&1
_scratch_mount

# There's a known EIO failure to report collisions between directio and buffered
# writes to userspace, refer to upstream linux 5a9d929d6e13. So ignore EIO error
# at here.
$FIO_PROG $fio_config --ignore_error=,EIO --output=$fio_out
cat $fio_out >> $seqres.full
echo "Silence is golden"

# xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
# direct IO on the same file. On the other hand, this fio job has been proven
# to be potent, we don't want to simply _disable_dmesg_check which could miss
# other potential bugs. So filter out the intentional WARNINGs, make sure test
# doesn't fail because of this warning and fails on other WARNINGs.

# umount before checking dmesg in case umount triggers any WARNING or Oops
_scratch_unmount

_check_dmesg _filter_aiodio_dmesg

status=$?
exit