* [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs
@ 2026-04-30 13:13 Lukas Herbolt
2026-04-30 13:13 ` [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available Lukas Herbolt
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Lukas Herbolt @ 2026-04-30 13:13 UTC (permalink / raw)
To: zlang, djwong; +Cc: fstests, Lukas Herbolt
Since xfsprogs v6.13.0 mkfs.xfs scales the log size on SSDs with the amount
of CPUs. This leads to various failures from ENOSPC in generic/102 and generic172
(the xfs log can take up to 256MB on 1GB test FS) or depleting the dmthin
metadata area in generic/347. Downsize of the percentage change is we cannot
longer check the exact amount of data xfs_io wrote in the generic/102 test.
The xfs/21{6,7} are testing the old behavior before the concurrency option was
introduced. Forcing the old behavior on newer mkfs.xfs.
Lukas Herbolt (4):
common/rc: Add helper to calculate percetage of free space available
common/xfs: helper function to check if -l/-d/-r concurrecy flags.
generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs +
SSDs
xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports
it
common/rc | 8 ++++++++
common/xfs | 6 ++++++
tests/generic/102 | 5 +++--
tests/generic/102.out | 20 ++++++++++----------
tests/generic/172 | 8 ++++----
tests/generic/347 | 9 ++++++++-
tests/xfs/216 | 9 +++++++--
tests/xfs/217 | 17 +++++++++++++++--
8 files changed, 61 insertions(+), 21 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available
2026-04-30 13:13 [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs Lukas Herbolt
@ 2026-04-30 13:13 ` Lukas Herbolt
2026-04-30 16:42 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags Lukas Herbolt
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Lukas Herbolt @ 2026-04-30 13:13 UTC (permalink / raw)
To: zlang, djwong; +Cc: fstests, Lukas Herbolt
It calculates percentage of filesystem available space and returns it
in MB. This helper will be used in the following test/generic fixes.
Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
---
common/rc | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/common/rc b/common/rc
index 5fe44e2158ff..32c566cdb68a 100644
--- a/common/rc
+++ b/common/rc
@@ -6189,6 +6189,14 @@ _require_fanotify_ioerrors()
_notrun "$FSTYP does not support fanotify ioerrors"
}
+# Returns percentage of available space on given mount point.
+# usage example:
+# _mb_pct_of_available_space <mount point> <percents>
+#
+_mb_pct_of_available_space()
+{
+ _df_device $1 | $AWK_PROG -v pct=$2 '{printf "%.f", (($5*(pct/100))/1024)}'
+}
################################################################################
# make sure this script returns success
/bin/true
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags.
2026-04-30 13:13 [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs Lukas Herbolt
2026-04-30 13:13 ` [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available Lukas Herbolt
@ 2026-04-30 13:13 ` Lukas Herbolt
2026-04-30 16:39 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs Lukas Herbolt
2026-04-30 13:13 ` [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it Lukas Herbolt
3 siblings, 1 reply; 10+ messages in thread
From: Lukas Herbolt @ 2026-04-30 13:13 UTC (permalink / raw)
To: zlang, djwong; +Cc: fstests, Lukas Herbolt
Check if the requested flag is supported by the mkfs.xfs on scratch
device.
Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
---
common/xfs | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/common/xfs b/common/xfs
index f7a6d2f2f03a..12cf6c273c53 100644
--- a/common/xfs
+++ b/common/xfs
@@ -2399,3 +2399,9 @@ _require_xfs_healer()
_xfs_healer --supported "$@" &>/dev/null || \
_notrun "health monitoring not supported on this kernel"
}
+
+# Check if -l/-d/-r concurrency is supported.
+_scratch_mkfs_supports_concurrency()
+{
+ _scratch_mkfs_xfs_supported $1 concurrency=0
+}
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs
2026-04-30 13:13 [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs Lukas Herbolt
2026-04-30 13:13 ` [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available Lukas Herbolt
2026-04-30 13:13 ` [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags Lukas Herbolt
@ 2026-04-30 13:13 ` Lukas Herbolt
2026-04-30 16:31 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it Lukas Herbolt
3 siblings, 1 reply; 10+ messages in thread
From: Lukas Herbolt @ 2026-04-30 13:13 UTC (permalink / raw)
To: zlang, djwong; +Cc: fstests, Lukas Herbolt
XFS will now scale by default its log size according the amount of CPUs. This
can significantly increase the log area and using hardcoded size of file size
will make the test file. Using the the X percent of the free space to create
the file will let the test proceed.
For generic/102 we also have to change the 102.out as we cannot know the
amount written data and it has to be filterred out.
For generic/172 we just use the new function to calculate file big enough
to consume most of the available space.
The generic/347 will use -l concurency=0 in case it is being run on the
XFS filesystem and mkfs.xfs already supports this option.
Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
---
tests/generic/102 | 5 +++--
tests/generic/102.out | 20 ++++++++++----------
tests/generic/172 | 8 ++++----
tests/generic/347 | 9 ++++++++-
4 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/tests/generic/102 b/tests/generic/102
index daa5061bd3fe..60e651fefb5b 100755
--- a/tests/generic/102
+++ b/tests/generic/102
@@ -23,12 +23,13 @@ _require_scratch
dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem
_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
_scratch_mount
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 95`
for ((i = 0; i < 10; i++)); do
echo "loop $i" >>$seqres.full
- $XFS_IO_PROG -f -c "pwrite -b 1m 0 800m" "$SCRATCH_MNT"/file | \
-_filter_xfs_io | _filter_scratch
+ $XFS_IO_PROG -f -c "pwrite -b 1m 0 ${file_size}m" "$SCRATCH_MNT"/file | \
+_filter_xfs_io_numbers | _filter_scratch
rm -f "$SCRATCH_MNT"/file
done
diff --git a/tests/generic/102.out b/tests/generic/102.out
index b58aa5ccc68b..647bb23abec1 100644
--- a/tests/generic/102.out
+++ b/tests/generic/102.out
@@ -1,21 +1,21 @@
QA output created by 102
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 838860800/838860800 bytes at offset 0
+wrote XXXX/XXXX bytes at offset XXXX
XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
diff --git a/tests/generic/172 b/tests/generic/172
index b67e817b667b..06f9370f065d 100755
--- a/tests/generic/172
+++ b/tests/generic/172
@@ -37,15 +37,15 @@ echo "Reformat with appropriate size"
blksz="$(_get_block_size $testdir)"
_scratch_unmount
-file_size=$((768 * 1024 * 1024))
fs_size=$((1024 * 1024 * 1024))
_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
+file_size=`_mb_pct_of_available_space $SCRATCH_DEV 70`
echo "Create a big file and reflink it"
-_pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1
+_pwrite_byte 0x61 0 ${file_size}m $testdir/bigfile >> $seqres.full 2>&1
_cp_reflink $testdir/bigfile $testdir/clonefile
_scratch_sync
@@ -54,7 +54,7 @@ _fill_fs $fs_size $testdir/space $blksz 0 >> $seqres.full 2>&1
_scratch_sync
echo "CoW the big file"
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
_filter_xfs_io_error)"
echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
echo ${out} >> $seqres.full 2>&1
@@ -63,7 +63,7 @@ echo ${out}
echo "Remount and try CoW again"
_scratch_cycle_mount
-out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
+out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
_filter_xfs_io_error)"
echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
echo ${out} >> $seqres.full 2>&1
diff --git a/tests/generic/347 b/tests/generic/347
index 5c0e3f949585..cf3cfc94c8c4 100755
--- a/tests/generic/347
+++ b/tests/generic/347
@@ -14,6 +14,13 @@ BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
+dmthin_mkfs_opts=""
+if [ $FSTYP == "xfs" ]; then
+ if _scratch_mkfs_xfs_supported -l concurrency=0 >> $seqres.full 2>&1; then
+ dmthin_mkfs_opts="-l concurrency=0"
+ fi
+fi
+
# Override the default cleanup function.
_cleanup()
{
@@ -25,7 +32,7 @@ _setup_thin()
{
_dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
_dmthin_set_queue
- _dmthin_mkfs
+ _dmthin_mkfs $dmthin_mkfs_opts
_dmthin_mount
}
--
2.53.0
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it
2026-04-30 13:13 [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs Lukas Herbolt
` (2 preceding siblings ...)
2026-04-30 13:13 ` [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs Lukas Herbolt
@ 2026-04-30 13:13 ` Lukas Herbolt
2026-04-30 16:36 ` Darrick J. Wong
3 siblings, 1 reply; 10+ messages in thread
From: Lukas Herbolt @ 2026-04-30 13:13 UTC (permalink / raw)
To: zlang, djwong; +Cc: fstests, Lukas Herbolt
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 <lukas@herbolt.com>
---
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
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs
2026-04-30 13:13 ` [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs Lukas Herbolt
@ 2026-04-30 16:31 ` Darrick J. Wong
0 siblings, 0 replies; 10+ messages in thread
From: Darrick J. Wong @ 2026-04-30 16:31 UTC (permalink / raw)
To: Lukas Herbolt; +Cc: zlang, fstests
On Thu, Apr 30, 2026 at 03:13:20PM +0200, Lukas Herbolt wrote:
> XFS will now scale by default its log size according the amount of CPUs. This
> can significantly increase the log area and using hardcoded size of file size
> will make the test file. Using the the X percent of the free space to create
> the file will let the test proceed.
>
> For generic/102 we also have to change the 102.out as we cannot know the
> amount written data and it has to be filterred out.
>
> For generic/172 we just use the new function to calculate file big enough
> to consume most of the available space.
>
> The generic/347 will use -l concurency=0 in case it is being run on the
> XFS filesystem and mkfs.xfs already supports this option.
>
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> ---
> tests/generic/102 | 5 +++--
> tests/generic/102.out | 20 ++++++++++----------
> tests/generic/172 | 8 ++++----
> tests/generic/347 | 9 ++++++++-
> 4 files changed, 25 insertions(+), 17 deletions(-)
>
> diff --git a/tests/generic/102 b/tests/generic/102
> index daa5061bd3fe..60e651fefb5b 100755
> --- a/tests/generic/102
> +++ b/tests/generic/102
> @@ -23,12 +23,13 @@ _require_scratch
> dev_size=$((1024 * 1024 * 1024)) # 1GB filesystem
> _scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
> _scratch_mount
> +file_size=`_mb_pct_of_available_space $SCRATCH_DEV 95`
>
> for ((i = 0; i < 10; i++)); do
> echo "loop $i" >>$seqres.full
>
> - $XFS_IO_PROG -f -c "pwrite -b 1m 0 800m" "$SCRATCH_MNT"/file | \
> -_filter_xfs_io | _filter_scratch
> + $XFS_IO_PROG -f -c "pwrite -b 1m 0 ${file_size}m" "$SCRATCH_MNT"/file | \
> +_filter_xfs_io_numbers | _filter_scratch
Ah, ok, so we're using 95% of the available space, not just a static
800M? That's a pretty big difference...
> rm -f "$SCRATCH_MNT"/file
> done
> diff --git a/tests/generic/102.out b/tests/generic/102.out
> index b58aa5ccc68b..647bb23abec1 100644
> --- a/tests/generic/102.out
> +++ b/tests/generic/102.out
> @@ -1,21 +1,21 @@
> QA output created by 102
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> -wrote 838860800/838860800 bytes at offset 0
> +wrote XXXX/XXXX bytes at offset XXXX
> XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
> diff --git a/tests/generic/172 b/tests/generic/172
> index b67e817b667b..06f9370f065d 100755
> --- a/tests/generic/172
> +++ b/tests/generic/172
> @@ -37,15 +37,15 @@ echo "Reformat with appropriate size"
> blksz="$(_get_block_size $testdir)"
> _scratch_unmount
>
> -file_size=$((768 * 1024 * 1024))
> fs_size=$((1024 * 1024 * 1024))
> _scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
> _scratch_mount >> $seqres.full 2>&1
> rm -rf $testdir
> mkdir $testdir
> +file_size=`_mb_pct_of_available_space $SCRATCH_DEV 70`
...particularly since you replace 768/1024 with 70% here.
> echo "Create a big file and reflink it"
> -_pwrite_byte 0x61 0 $file_size $testdir/bigfile >> $seqres.full 2>&1
> +_pwrite_byte 0x61 0 ${file_size}m $testdir/bigfile >> $seqres.full 2>&1
> _cp_reflink $testdir/bigfile $testdir/clonefile
> _scratch_sync
>
> @@ -54,7 +54,7 @@ _fill_fs $fs_size $testdir/space $blksz 0 >> $seqres.full 2>&1
> _scratch_sync
>
> echo "CoW the big file"
> -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
> +out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
> _filter_xfs_io_error)"
> echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
> echo ${out} >> $seqres.full 2>&1
> @@ -63,7 +63,7 @@ echo ${out}
> echo "Remount and try CoW again"
> _scratch_cycle_mount
>
> -out="$(_pwrite_byte 0x62 0 $file_size $testdir/bigfile 2>&1 | \
> +out="$(_pwrite_byte 0x62 0 ${file_size}m $testdir/bigfile 2>&1 | \
> _filter_xfs_io_error)"
> echo ${out} | grep -q "No space left on device" || echo "CoW should have failed with ENOSPC"
> echo ${out} >> $seqres.full 2>&1
> diff --git a/tests/generic/347 b/tests/generic/347
> index 5c0e3f949585..cf3cfc94c8c4 100755
> --- a/tests/generic/347
> +++ b/tests/generic/347
> @@ -14,6 +14,13 @@ BACKING_SIZE=$((500 * 1024 * 1024 / 512)) # 500M
> VIRTUAL_SIZE=$((10 * $BACKING_SIZE)) # 5000M
> GROW_SIZE=$((100 * 1024 * 1024 / 512)) # 100M
>
> +dmthin_mkfs_opts=""
> +if [ $FSTYP == "xfs" ]; then
> + if _scratch_mkfs_xfs_supported -l concurrency=0 >> $seqres.full 2>&1; then
_scratch_mkfs_supports_concurrency ?
> + dmthin_mkfs_opts="-l concurrency=0"
> + fi
> +fi
> +
> # Override the default cleanup function.
> _cleanup()
> {
> @@ -25,7 +32,7 @@ _setup_thin()
> {
> _dmthin_init $BACKING_SIZE $VIRTUAL_SIZE
> _dmthin_set_queue
> - _dmthin_mkfs
> + _dmthin_mkfs $dmthin_mkfs_opts
> _dmthin_mount
> }
>
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it
2026-04-30 13:13 ` [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it Lukas Herbolt
@ 2026-04-30 16:36 ` Darrick J. Wong
2026-05-14 8:11 ` Lukas Herbolt
0 siblings, 1 reply; 10+ messages in thread
From: Darrick J. Wong @ 2026-04-30 16:36 UTC (permalink / raw)
To: Lukas Herbolt; +Cc: zlang, fstests
On Thu, Apr 30, 2026 at 03:13:22PM +0200, Lukas Herbolt wrote:
> The XFS conccurency optimalization breaks the log sizing check on
"concurrency optimization"
> systems with non-rotational disks and high amount of CPUs. Default to
> the old behavior with -l conccurency=0 and with -d concurrency=0.
"-l concurrency=0"
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> ---
> 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
Why does the scratch fs need a -lconcurrency option?
> + 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"
concurrency= was added for -d and -l in the same release (6.7) so you
don't have to test them separately.
--D
> +
> + 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
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags.
2026-04-30 13:13 ` [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags Lukas Herbolt
@ 2026-04-30 16:39 ` Darrick J. Wong
0 siblings, 0 replies; 10+ messages in thread
From: Darrick J. Wong @ 2026-04-30 16:39 UTC (permalink / raw)
To: Lukas Herbolt; +Cc: zlang, fstests
On Thu, Apr 30, 2026 at 03:13:18PM +0200, Lukas Herbolt wrote:
> Check if the requested flag is supported by the mkfs.xfs on scratch
> device.
>
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> ---
> common/xfs | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/common/xfs b/common/xfs
> index f7a6d2f2f03a..12cf6c273c53 100644
> --- a/common/xfs
> +++ b/common/xfs
> @@ -2399,3 +2399,9 @@ _require_xfs_healer()
> _xfs_healer --supported "$@" &>/dev/null || \
> _notrun "health monitoring not supported on this kernel"
> }
> +
> +# Check if -l/-d/-r concurrency is supported.
> +_scratch_mkfs_supports_concurrency()
This is specific to xfs, so I think the name should reflect that.
_scratch_mkfs_xfs_supports_concurrency
> +{
> + _scratch_mkfs_xfs_supported $1 concurrency=0
> +}
As I noted downthread, -d and -l gained their concurrency= options in
the same release so we probably ought to do future fstests authors a
favor and note that in the comments or just do something dorky like:
_scratch_mkfs_xfs_supports_concurrency()
{
local arg="${1:-d}"
# -d and -l gained concurrency options at the same time
test "$arg" = "-l" && arg="-d"
_scratch_mkfs_xfs_supported "$arg" concurrency=0
}
--D
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available
2026-04-30 13:13 ` [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available Lukas Herbolt
@ 2026-04-30 16:42 ` Darrick J. Wong
0 siblings, 0 replies; 10+ messages in thread
From: Darrick J. Wong @ 2026-04-30 16:42 UTC (permalink / raw)
To: Lukas Herbolt; +Cc: zlang, fstests
"percentage" in the subject line
On Thu, Apr 30, 2026 at 03:13:16PM +0200, Lukas Herbolt wrote:
> It calculates percentage of filesystem available space and returns it
> in MB. This helper will be used in the following test/generic fixes.
>
> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
> ---
> common/rc | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/common/rc b/common/rc
> index 5fe44e2158ff..32c566cdb68a 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -6189,6 +6189,14 @@ _require_fanotify_ioerrors()
> _notrun "$FSTYP does not support fanotify ioerrors"
> }
>
> +# Returns percentage of available space on given mount point.
“Computes a percentage of the available space in a filesystem and
returns that quantity in MB. The percentage must not contain a percent
sign ("%").”
> +# usage example:
> +# _mb_pct_of_available_space <mount point> <percents>
s/percents/percent/
--D
> +#
> +_mb_pct_of_available_space()
> +{
> + _df_device $1 | $AWK_PROG -v pct=$2 '{printf "%.f", (($5*(pct/100))/1024)}'
> +}
> ################################################################################
> # make sure this script returns success
> /bin/true
> --
> 2.53.0
>
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it
2026-04-30 16:36 ` Darrick J. Wong
@ 2026-05-14 8:11 ` Lukas Herbolt
0 siblings, 0 replies; 10+ messages in thread
From: Lukas Herbolt @ 2026-05-14 8:11 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: zlang, fstests
On 2026-04-30 18:36, Darrick J. Wong wrote:
> On Thu, Apr 30, 2026 at 03:13:22PM +0200, Lukas Herbolt wrote:
>> The XFS conccurency optimalization breaks the log sizing check on
>
> "concurrency optimization"
>
>> systems with non-rotational disks and high amount of CPUs. Default to
>> the old behavior with -l conccurency=0 and with -d concurrency=0.
>
> "-l concurrency=0"
>
>> Signed-off-by: Lukas Herbolt <lukas@herbolt.com>
>> ---
>> 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
>
> Why does the scratch fs need a -lconcurrency option?
Yeah right it does not need it. Wanted to be sure we do not run into
-ENOSPC but on recommended 10G SCRATCH_DEV we should not.
>
>> + 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"
>
> concurrency= was added for -d and -l in the same release (6.7) so you
> don't have to test them separately.
Just wanted to be sure as those still came in different commits.
>
> --D
>
>> +
>> + 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
>>
>>
--
-lhe
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2026-05-14 8:16 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-30 13:13 [PATCH 0/4] Fixes for mkfs.xfs with high amount of CPUs and SSDs Lukas Herbolt
2026-04-30 13:13 ` [PATCH 1/4] common/rc: Add helper to calculate percetage of free space available Lukas Herbolt
2026-04-30 16:42 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 2/4] common/xfs: helper function to check if -l/-d/-r concurrecy flags Lukas Herbolt
2026-04-30 16:39 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 3/4] generic/{102,172,347}: Adapt test for XFS on systems with 128+CPUs + SSDs Lukas Herbolt
2026-04-30 16:31 ` Darrick J. Wong
2026-04-30 13:13 ` [PATCH 4/4] xfs/216 xfs/217 Use default -l conccurency=0 on mkfs.xfs that supports it Lukas Herbolt
2026-04-30 16:36 ` Darrick J. Wong
2026-05-14 8:11 ` Lukas Herbolt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox