[PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it

Lukas Herbolt <[email protected]>
Newsgroups org.kernel.vger.fstests
Message-ID <[email protected]>
The XFS conccurency optimalization breaks the log sizing check on
systems with non-rotational disks and high amount of CPUs. Default to
the old behavior with -l conccurency=0 and with -d concurrency=0.

Signed-off-by: Lukas Herbolt <[email protected]>
---
 tests/xfs/216 |  9 +++++++--
 tests/xfs/217 | 17 +++++++++++++++--
 2 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/tests/xfs/216 b/tests/xfs/216
index 091c11d08642..8b4610d5a0a6 100755
--- a/tests/xfs/216
+++ b/tests/xfs/216
@@ -21,14 +21,19 @@ _cleanup()
 }
 
 _require_scratch
-_scratch_mkfs_xfs >/dev/null 2>&1
+if _scratch_mkfs_supports_concurrency -l >> $seqres.full 2>&1; then
+	_scratch_mkfs_xfs -l concurrency=0 >/dev/null 2>&1
+	loop_mkfs_opts="-l concurrency=0"
+else
+	_scratch_mkfs_xfs >/dev/null 2>&1
+	loop_mkfs_opts=
+fi
 _scratch_mount
 
 _require_loop
 LOOP_IMG=$SCRATCH_MNT/test_fs
 LOOP_MNT=$SCRATCH_MNT/test_fs_dir
 
-loop_mkfs_opts=
 $MKFS_XFS_PROG 2>&1 | grep -q rmapbt && \
 	loop_mkfs_opts="$loop_mkfs_opts -m rmapbt=0"
 $MKFS_XFS_PROG 2>&1 | grep -q reflink && \
diff --git a/tests/xfs/217 b/tests/xfs/217
index dae6ce55f475..7c7b33b1ccf7 100755
--- a/tests/xfs/217
+++ b/tests/xfs/217
@@ -20,7 +20,20 @@ _cleanup()
 }
 
 _require_scratch
-_scratch_mkfs_xfs >/dev/null 2>&1
+if _scratch_mkfs_supports_concurrency -l >> $seqres.full 2>&1; then
+	_scratch_mkfs_xfs -l concurrency=0 >/dev/null 2>&1
+	loop_mkfs_opts="-l concurrency=0"
+		if _scratch_mkfs_supports_concurrency -d >> $seqres.full 2>&1; then
+			# We could go just with -l concurency but then on 512CPUs
+			# it gives log size off by one block so better to set
+			# -d concurrency to 0.
+			loop_mkfs_opts="$loop_mkfs_opts -d concurrency=0"
+
+		fi
+else
+	_scratch_mkfs_xfs >/dev/null 2>&1
+	loop_mkfs_opts=
+fi
 _scratch_mount
 # 16T mkfs requires a bit over 2G free
 _require_fs_space $SCRATCH_MNT 2202000
@@ -34,7 +47,7 @@ _do_mkfs()
 	for i in $*; do
 		echo -n "fssize=${i}g "
 		$MKFS_XFS_PROG -f -b size=4096 -l version=2 \
-			-d size=${i}g $loop_dev |grep log
+			-d size=${i}g $loop_dev $loop_mkfs_opts |grep log
 		_mount $loop_dev $LOOP_MNT
 		echo "test write" > $LOOP_MNT/test
 		_unmount $LOOP_MNT > /dev/null 2>&1
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.