From fe272bc1c514a45027f2aea88c7d0495007c3112 Mon Sep 17 00:00:00 2001 From: Eryu Guan Date: Tue, 4 Aug 2015 14:10:48 +1000 Subject: [PATCH] generic: concurrent IO test with mixed IO types Test concurrent buffered I/O, DIO, AIO, mmap I/O and splice I/O on the same files. Signed-off-by: Eryu Guan Reviewed-by: Dave Chinner Signed-off-by: Dave Chinner --- tests/generic/095 | 141 ++++++++++++++++++++++++++++++++++++++++++ tests/generic/095.out | 2 + tests/generic/group | 1 + 3 files changed, 144 insertions(+) create mode 100755 tests/generic/095 create mode 100644 tests/generic/095.out diff --git a/tests/generic/095 b/tests/generic/095 new file mode 100755 index 00000000..11230804 --- /dev/null +++ b/tests/generic/095 @@ -0,0 +1,141 @@ +#! /bin/bash +# FS QA Test generic/095 +# +# Concurrent mixed I/O (buffer I/O, aiodio, mmap, splice) on the same files +# +#----------------------------------------------------------------------- +# Copyright (c) 2015 Red Hat Inc. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation. +# +# This program is distributed in the hope that it would be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +#----------------------------------------------------------------------- +# + +seq=`basename $0` +seqres=$RESULT_DIR/$seq +echo "QA output created by $seq" + +here=`pwd` +tmp=/tmp/$$ +status=1 # failure is the default! +trap "_cleanup; exit \$status" 0 1 2 3 15 + +_cleanup() +{ + cd / + rm -f $tmp.* +} + +# get standard environment, filters and checks +. ./common/rc +. ./common/filter + +# real QA test starts here +_supported_fs generic +_supported_os Linux +_require_scratch + +iodepth=$((16 * LOAD_FACTOR)) +iodepth_batch=$((8 * LOAD_FACTOR)) +numjobs=$((5 * LOAD_FACTOR)) +fio_config=$tmp.fio +cat >$fio_config <> $fio_config + +rm -f $seqres.full +_require_fio $fio_config +_scratch_mkfs >>$seqres.full 2>&1 +_scratch_mount + +echo "Silence is golden" +$FIO_PROG $fio_config >>$seqres.full 2>&1 + +# 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. +filter_xfs_dmesg() +{ + local warn1="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_dio_aio_write.*" + local warn2="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_read_iter.*" + sed -e "s#$warn1#Intentional warnings in xfs_file_dio_aio_write#" \ + -e "s#$warn2#Intentional warnings in xfs_file_read_iter#" +} + +# umount before checking dmesg in case umount triggers any WARNING or Oops +_scratch_unmount + +if [ "$FSTYP" == "xfs" ]; then + _check_dmesg filter_xfs_dmesg +else + _check_dmesg +fi +status=$? +exit diff --git a/tests/generic/095.out b/tests/generic/095.out new file mode 100644 index 00000000..80ad3b9c --- /dev/null +++ b/tests/generic/095.out @@ -0,0 +1,2 @@ +QA output created by 095 +Silence is golden diff --git a/tests/generic/group b/tests/generic/group index f9fc403c..ed217f7f 100644 --- a/tests/generic/group +++ b/tests/generic/group @@ -97,6 +97,7 @@ 092 auto quick prealloc 093 attr cap udf auto 094 auto quick prealloc +095 auto rw stress 097 udf auto 099 udf auto 100 udf auto -- 2.39.5