Skip to contentSkip to conversation

xfststs: add a helper to get the minimum dio size

PATCH In review Christoph Hellwig 3 participants 6 messages Nov 6, 2013 – Nov 13, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfststs: add a helper to get the minimum dio size

Various tests opencode checks to find out the minimum support direct I/O size. Replace those with a generic helper that handles network filesystems as well. Also remove the Linux 2.4 workaround we had in once place.

common/rc +15 -0
index ea3af12..64139c8 100644
@@ -2179,6 +2179,21 @@ _scale_fsstress_args()
     echo $args
 }
 
+#
+# Return the logical block size if running on a block device,
+# else substitute the page size.
+#
+_min_dio_alignment()
+{
+    dev=$1
+
+    if [ -b "$dev" ]; then
+        blockdev --getss $dev
+    else
+        $here/src/feature -s
+    fi
+}
+
 run_check()
 {
 	echo "# $@" >> $seqres.full 2>&1
tests/generic/091 +1 -5
index cee012d..d0f5800 100755
@@ -54,11 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
-kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
-
-# 2.4 Linux kernels support bsize aligned direct I/O only
-[ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
+bsize=`_min_dio_alignment $TEST_DEV`
 
 # fsx usage:
 # 
tests/generic/240 +1 -1
index e692318..d3fd442 100755
@@ -60,7 +60,7 @@ rm -f $seqres.full
 
 rm -f $TEST_DIR/aiodio_sparse
 
-logical_block_size=`blockdev --getss $TEST_DEV`
+logical_block_size=`_min_dio_alignment $TEST_DEV`
 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
 
 if [ $fs_block_size -le $logical_block_size ]; then
tests/generic/263 +1 -1
index 377b199..094c3d1 100755
@@ -54,7 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
+bsize=`_min_dio_alignment $TEST_DEV`
 
 run_fsx -N 10000  -o 8192   -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
 run_fsx -N 10000  -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#1 lore raw

ping?

Quoted 76 lines · Christoph Hellwig

Various tests opencode checks to find out the minimum support direct I/O size. Replace those with a generic helper that handles network filesystems as well. Also remove the Linux 2.4 workaround we had in once place.

common/rc +15 -0
index ea3af12..64139c8 100644
@@ -2179,6 +2179,21 @@ _scale_fsstress_args()
     echo $args
 }
 
+#
+# Return the logical block size if running on a block device,
+# else substitute the page size.
+#
+_min_dio_alignment()
+{
+    dev=$1
+
+    if [ -b "$dev" ]; then
+        blockdev --getss $dev
+    else
+        $here/src/feature -s
+    fi
+}
+
 run_check()
 {
 	echo "# $@" >> $seqres.full 2>&1
tests/generic/091 +1 -5
index cee012d..d0f5800 100755
@@ -54,11 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
-kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
-
-# 2.4 Linux kernels support bsize aligned direct I/O only
-[ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
+bsize=`_min_dio_alignment $TEST_DEV`
 
 # fsx usage:
 # 
tests/generic/240 +1 -1
index e692318..d3fd442 100755
@@ -60,7 +60,7 @@ rm -f $seqres.full
 
 rm -f $TEST_DIR/aiodio_sparse
 
-logical_block_size=`blockdev --getss $TEST_DEV`
+logical_block_size=`_min_dio_alignment $TEST_DEV`
 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
 
 if [ $fs_block_size -le $logical_block_size ]; then
tests/generic/263 +1 -1
index 377b199..094c3d1 100755
@@ -54,7 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
+bsize=`_min_dio_alignment $TEST_DEV`
 
 run_fsx -N 10000  -o 8192   -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
 run_fsx -N 10000  -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
Quoted 4 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

---end quoted text---

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

Reviewed-by on v1 1/1
#2 lore raw
In reply to Christoph Hellwig
Quoted 5 lines · Christoph Hellwig

Various tests opencode checks to find out the minimum support direct I/O size. Replace those with a generic helper that handles network filesystems as well. Also remove the Linux 2.4 workaround we had in once place.

No callers of min_dio_alignment w/o a blockdev right? But I guess that fallback is harmless.

Quoted 70 lines
common/rc +15 -0
index ea3af12..64139c8 100644
@@ -2179,6 +2179,21 @@ _scale_fsstress_args()
     echo $args
 }
 
+#
+# Return the logical block size if running on a block device,
+# else substitute the page size.
+#
+_min_dio_alignment()
+{
+    dev=$1
+
+    if [ -b "$dev" ]; then
+        blockdev --getss $dev
+    else
+        $here/src/feature -s
+    fi
+}
+
 run_check()
 {
 	echo "# $@" >> $seqres.full 2>&1
tests/generic/091 +1 -5
index cee012d..d0f5800 100755
@@ -54,11 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
-kernel=`uname -r  | sed -e 's/\(2\..\).*/\1/'`
-
-# 2.4 Linux kernels support bsize aligned direct I/O only
-[ "$HOSTOS" = "Linux" -a "$kernel" = "2.4" ] && bsize=$psize
+bsize=`_min_dio_alignment $TEST_DEV`
 
 # fsx usage:
 # 
tests/generic/240 +1 -1
index e692318..d3fd442 100755
@@ -60,7 +60,7 @@ rm -f $seqres.full
 
 rm -f $TEST_DIR/aiodio_sparse
 
-logical_block_size=`blockdev --getss $TEST_DEV`
+logical_block_size=`_min_dio_alignment $TEST_DEV`
 fs_block_size=`stat -f $TEST_DIR | grep "Block size:" | awk '{print $3}'`
 
 if [ $fs_block_size -le $logical_block_size ]; then
tests/generic/263 +1 -1
index 377b199..094c3d1 100755
@@ -54,7 +54,7 @@ run_fsx()
 }
 
 psize=`$here/src/feature -s`
-bsize=`blockdev --getss $TEST_DEV`
+bsize=`_min_dio_alignment $TEST_DEV`
 
 run_fsx -N 10000  -o 8192   -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
 run_fsx -N 10000  -o 128000 -l 500000 -r PSIZE -t BSIZE -w BSIZE -Z
Quoted 5 lines

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#3 lore raw
Quoted 9 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig

Various tests opencode checks to find out the minimum support direct I/O size. Replace those with a generic helper that handles network filesystems as well. Also remove the Linux 2.4 workaround we had in once place.

No callers of min_dio_alignment w/o a blockdev right? But I guess that fallback is harmless.

All network filesystems will not have a device here. Not sure how the btrfs pool names work, but that would be another suspect.

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs

#4 lore raw
Quoted 6 lines · Christoph Hellwig
Quoted 5 lines · Eric Sandeen
Quoted 4 lines · Christoph Hellwig

Various tests opencode checks to find out the minimum support direct I/O size. Replace those with a generic helper that handles network filesystems as well. Also remove the Linux 2.4 workaround we had in once place.

Quoted 8 lines
Quoted 4 lines
Quoted 1 line

No callers of min_dio_alignment w/o a blockdev right? But I guess that fallback is harmless.

All network filesystems will not have a device here. Not sure how the btrfs pool names work, but that would be another suspect.

Ah, sure. So when running on NFS the blkdev is unset. Wasn't thinking about it that way, thanks.

-Eric

_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs