2 # SPDX-License-Identifier: GPL-2.0
3 # Copyright (c) 2017 Red Hat Inc. All Rights Reserved.
7 # mmap direct/buffered io between DAX and non-DAX mountpoints.
10 seqres=$RESULT_DIR/$seq
11 echo "QA output created by $seq"
15 status=1 # failure is the default!
16 trap "_cleanup; exit \$status" 0 1 2 3 15
24 # get standard environment, filters and checks
28 # remove previous $seqres.full before test
33 _require_scratch_dax_mountopt "dax"
34 _require_test_program "feature"
35 _require_test_program "t_mmap_dio"
36 _require_xfs_io_command "falloc"
40 rm -f $SCRATCH_MNT/tf_{s,d}
41 rm -f $TEST_DIR/tf_{s,d}
43 $XFS_IO_PROG -f -c "falloc 0 $tsize" \
44 $SCRATCH_MNT/tf_{s,d} >> $seqres.full 2>&1
45 $XFS_IO_PROG -f -c "falloc 0 $tsize" \
46 $TEST_DIR/tf_{s,d} >> $seqres.full 2>&1
53 $here/src/t_mmap_dio $SCRATCH_MNT/tf_{s,d} $1 "dio both dax"
56 # again with buffered IO
57 $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_{s,d} \
58 $1 "buffered both dax"
64 $here/src/t_mmap_dio $TEST_DIR/tf_s \
65 $SCRATCH_MNT/tf_d $1 "dio nondax to dax"
68 $here/src/t_mmap_dio -b $TEST_DIR/tf_s \
69 $SCRATCH_MNT/tf_d $1 "buffered nondax to dax"
75 $here/src/t_mmap_dio $SCRATCH_MNT/tf_s \
76 $TEST_DIR/tf_d $1 "dio dax to nondax"
79 $here/src/t_mmap_dio -b $SCRATCH_MNT/tf_s \
80 $TEST_DIR/tf_d $1 "buffered dax to nondax"
86 $here/src/t_mmap_dio $TEST_DIR/tf_{s,d} $1 "dio both nondax"
89 $here/src/t_mmap_dio -b $TEST_DIR/tf_{s,d} \
90 $1 "buffered both nondax"
93 # $1 mmap read/write size
104 # less than page size
107 t_mmap_dio_dax `$here/src/feature -s`
108 # bigger sizes, for PMD faults
109 t_mmap_dio_dax $((16 * 1024 * 1024))
110 t_mmap_dio_dax $((64 * 1024 * 1024))
113 # make fs aligned for PMD fault testing
114 _scratch_mkfs_geom $(_get_hugepagesize) 1 >> $seqres.full 2>&1
116 # mount SCRATCH_DEV with dax option, TEST_DEV not
117 export MOUNT_OPTIONS=""
118 export TEST_FS_MOUNT_OPTS=""
120 _fs_options $TEST_DEV | grep -qw "dax" && \
121 _notrun "we need $TEST_DEV mount without dax"
122 _scratch_mount "-o dax"
124 tsize=$((128 * 1024 * 1024))
129 echo "Silence is golden"