Skip to contentSkip to conversation

generalize AIO/DIO dmesg filter

PATCH In review Ilya Dryomov 2 participants 5 messages Oct 12, 2017

lore
Share & tools
lore
#0 lore raw

v2 cover generalize AIO/DIO dmesg filter

With upstream commit 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO"), we need to whitelist dio_complete() for ext4 pretty much everywhere iomap_dio_complete() and friends are whitelisted for xfs.

v1 -> v2:
- _filter_aiodio_dmesg() now lives in common/filter

Thanks,

Ilya

Ilya Dryomov (3):
common: move _filter_xfs_dmesg() to common/filter
common: turn _filter_xfs_dmesg() into _filter_aiodio_dmesg() generic/036,208: whitelist [iomap_]dio_complete() WARNs

 common/filter     | 25 +++++++++++++++++++++++++
 common/xfs        | 22 ----------------------
 tests/generic/036 |  2 ++
 tests/generic/095 |  7 ++-----
 tests/generic/208 |  2 ++
 tests/generic/224 |  9 +++------
 tests/generic/247 |  9 +++------
 tests/generic/446 |  9 +++------
 8 files changed, 40 insertions(+), 45 deletions(-)
Signature · 1 line
2.4.3
#1 lore raw

PATCH v2 1/3 common: move _filter_xfs_dmesg() to common/filter

---
 common/filter | 23 +++++++++++++++++++++++
 common/xfs    | 22 ----------------------
 2 files changed, 23 insertions(+), 22 deletions(-)
common/filter +23 -0
index 39ea140cb60f..441ee1a6e490 100644
@@ -448,5 +448,28 @@ _filter_filefrag()
 	      $flags, "\n"'
 }
 
+# xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
+# direct IO on the same file. This is a helper for _check_dmesg() to filter out
+# such 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_dio_aio_read.*"
+	local warn3="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_read_iter.*"
+	local warn4="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_aio_read.*"
+	local warn5="WARNING:.*fs/iomap\.c:.*iomap_dio_rw.*"
+	local warn6="WARNING:.*fs/xfs/xfs_aops\.c:.*__xfs_get_blocks.*"
+	local warn7="WARNING:.*fs/iomap\.c:.*iomap_dio_actor.*"
+	local warn8="WARNING:.*fs/iomap\.c:.*iomap_dio_complete.*"
+	sed -e "s#$warn1#Intentional warnings in xfs_file_dio_aio_write#" \
+	    -e "s#$warn2#Intentional warnings in xfs_file_dio_aio_read#" \
+	    -e "s#$warn3#Intentional warnings in xfs_file_read_iter#" \
+	    -e "s#$warn4#Intentional warnings in xfs_file_aio_read#" \
+	    -e "s#$warn5#Intentional warnings in iomap_dio_rw#" \
+	    -e "s#$warn6#Intentional warnings in __xfs_get_blocks#" \
+	    -e "s#$warn7#Intentional warnings in iomap_dio_actor#" \
+	    -e "s#$warn8#Intentional warnings in iomap_dio_complete#"
+}
+
 # make sure this script returns success
 /bin/true
common/xfs +0 -22
index 93eb50394984..d4fef941d321 100644
@@ -599,25 +599,3 @@ _require_no_xfs_debug()
 		_notrun "Require XFS built without CONFIG_XFS_DEBUG"
 	fi
 }
-# xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
-# direct IO on the same file. This is a helper for _check_dmesg() to filter out
-# such 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_dio_aio_read.*"
-	local warn3="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_read_iter.*"
-	local warn4="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_aio_read.*"
-	local warn5="WARNING:.*fs/iomap\.c:.*iomap_dio_rw.*"
-	local warn6="WARNING:.*fs/xfs/xfs_aops\.c:.*__xfs_get_blocks.*"
-	local warn7="WARNING:.*fs/iomap\.c:.*iomap_dio_actor.*"
-	local warn8="WARNING:.*fs/iomap\.c:.*iomap_dio_complete.*"
-	sed -e "s#$warn1#Intentional warnings in xfs_file_dio_aio_write#" \
-	    -e "s#$warn2#Intentional warnings in xfs_file_dio_aio_read#" \
-	    -e "s#$warn3#Intentional warnings in xfs_file_read_iter#" \
-	    -e "s#$warn4#Intentional warnings in xfs_file_aio_read#" \
-	    -e "s#$warn5#Intentional warnings in iomap_dio_rw#" \
-	    -e "s#$warn6#Intentional warnings in __xfs_get_blocks#" \
-	    -e "s#$warn7#Intentional warnings in iomap_dio_actor#" \
-	    -e "s#$warn8#Intentional warnings in iomap_dio_complete#"
-}
Signature · 1 line
2.4.3
#2 lore raw

PATCH v2 2/3 common: turn _filter_xfs_dmesg() into _filter_aiodio_dmesg()

In reply to Ilya Dryomov

With upstream commit 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO"), ext4 (and probably other non-iomap based filesystems) need a _check_dmesg() whitelist entry for a new WARN in dio_complete() -- generic/095 and 247 trigger a dio_complete() splat pretty reliably for me.

Add dio_complete() entry to _filter_xfs_dmesg(), rename it and use it unconditionally in generic/095, 224, 247 and 446.

---
 common/filter     | 8 +++++---
 tests/generic/095 | 7 ++-----
 tests/generic/224 | 9 +++------
 tests/generic/247 | 9 +++------
 tests/generic/446 | 9 +++------
 5 files changed, 16 insertions(+), 26 deletions(-)
common/filter +5 -3
index 441ee1a6e490..0cb458b0051f 100644
@@ -448,10 +448,10 @@ _filter_filefrag()
 	      $flags, "\n"'
 }
 
-# xfs generates WARNINGs on purpose when applications mix buffered/mmap IO with
+# We generate WARNINGs on purpose when applications mix buffered/mmap IO with
 # direct IO on the same file. This is a helper for _check_dmesg() to filter out
 # such warnings.
-_filter_xfs_dmesg()
+_filter_aiodio_dmesg()
 {
 	local warn1="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_dio_aio_write.*"
 	local warn2="WARNING:.*fs/xfs/xfs_file\.c:.*xfs_file_dio_aio_read.*"
@@ -461,6 +461,7 @@ _filter_xfs_dmesg()
 	local warn6="WARNING:.*fs/xfs/xfs_aops\.c:.*__xfs_get_blocks.*"
 	local warn7="WARNING:.*fs/iomap\.c:.*iomap_dio_actor.*"
 	local warn8="WARNING:.*fs/iomap\.c:.*iomap_dio_complete.*"
+	local warn9="WARNING:.*fs/direct-io\.c:.*dio_complete.*"
 	sed -e "s#$warn1#Intentional warnings in xfs_file_dio_aio_write#" \
 	    -e "s#$warn2#Intentional warnings in xfs_file_dio_aio_read#" \
 	    -e "s#$warn3#Intentional warnings in xfs_file_read_iter#" \
@@ -468,7 +469,8 @@ _filter_xfs_dmesg()
 	    -e "s#$warn5#Intentional warnings in iomap_dio_rw#" \
 	    -e "s#$warn6#Intentional warnings in __xfs_get_blocks#" \
 	    -e "s#$warn7#Intentional warnings in iomap_dio_actor#" \
-	    -e "s#$warn8#Intentional warnings in iomap_dio_complete#"
+	    -e "s#$warn8#Intentional warnings in iomap_dio_complete#" \
+	    -e "s#$warn9#Intentional warnings in dio_complete#"
 }
 
 # make sure this script returns success
tests/generic/095 +2 -5
index 050215d41700..fd4f13fd0a1b 100755
@@ -126,10 +126,7 @@ $FIO_PROG $fio_config >>$seqres.full 2>&1
 # 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
+_check_dmesg _filter_aiodio_dmesg
+
 status=$?
 exit
tests/generic/224 +3 -6
index 29b1c05d06df..6b3a81536aa8 100755
@@ -83,13 +83,10 @@ done
 wait
 echo "*** Silence is golden ***"
 
-# unmount and check dmesg, filtering out expected XFS warnings about mixed
+# unmount and check dmesg, filtering out expected warnings about mixed
 # direct and buffered I/O
 _scratch_unmount
-if [ "$FSTYP" == "xfs" ]; then
-	_check_dmesg _filter_xfs_dmesg
-else
-	_check_dmesg
-fi
+_check_dmesg _filter_aiodio_dmesg
+
 status=$?
 exit
tests/generic/247 +3 -6
index aac7078045ee..0614100cd7a8 100755
@@ -80,13 +80,10 @@ wait
 
 echo "Silence is golden."
 
-# unmount and check dmesg, filtering out expected XFS warnings about mixed
+# unmount and check dmesg, filtering out expected warnings about mixed
 # mmap/dio
 _test_unmount
-if [ "$FSTYP" == "xfs" ]; then
-	_check_dmesg _filter_xfs_dmesg
-else
-	_check_dmesg
-fi
+_check_dmesg _filter_aiodio_dmesg
+
 status=$?
 exit
tests/generic/446 +3 -6
index 6a1b69aa2edc..01228322911e 100755
@@ -79,13 +79,10 @@ wait $dread_pid > /dev/null 2>&1
 
 echo "Silence is golden"
 
-# check dmesg, filtering out expected XFS warnings about mixed mmap/dio
+# check dmesg, filtering out expected warnings about mixed mmap/dio
 # and umount first in case umount triggers warnings
 _scratch_unmount
-if [ "$FSTYP" == "xfs" ]; then
-	_check_dmesg _filter_xfs_dmesg
-else
-	_check_dmesg
-fi
+_check_dmesg _filter_aiodio_dmesg
+
 status=$?
 exit
Signature · 1 line
2.4.3
#3 lore raw

Re: [PATCH v2 2/3] common: turn _filter_xfs_dmesg() into _filter_aiodio_dmesg()

Quoted 10 lines · Ilya Dryomov

With upstream commit 332391a9935d ("fs: Fix page cache inconsistency when mixing buffered and AIO DIO"), ext4 (and probably other non-iomap based filesystems) need a _check_dmesg() whitelist entry for a new WARN in dio_complete() -- generic/095 and 247 trigger a dio_complete() splat pretty reliably for me.

Add dio_complete() entry to _filter_xfs_dmesg(), rename it and use it unconditionally in generic/095, 224, 247 and 446.

Thanks for the repost! I added "source ./common/filter" to generic/446 too, which was not sourced originally.

Thanks,
Eryu

#4 lore raw

PATCH v2 3/3 generic/036,208: whitelist [iomap_]dio_complete() WARNs

In reply to Ilya Dryomov

These tests appear to mix buffered and O_DIRECT I/O; easily triggered on both xfs and ext4.

---
 tests/generic/036 | 2 ++
 tests/generic/208 | 2 ++
 2 files changed, 4 insertions(+)
tests/generic/036 +2 -0
index 0615dad45e37..27e9916bc13a 100755
@@ -48,4 +48,6 @@ _require_test
 
 _run_aiodio aio-dio-fcntl-race
 
+_check_dmesg _filter_aiodio_dmesg
+
 exit $status
tests/generic/208 +2 -0
index f57e2bc76f8b..1768e4220e91 100755
@@ -50,4 +50,6 @@ rm -f $seqres.full
 
 _run_aiodio aio-dio-invalidate-failure
 
+_check_dmesg _filter_aiodio_dmesg
+
 exit $status
Signature · 1 line
2.4.3