Skip to contentSkip to conversation

cpu scaling fixes

PATCH In review Christoph Hellwig 3 participants 8 messages Jun 18 – Jun 19

lore
Share & tools
lore
#0 lore raw

Hi all,

this series fully disables the mkfs automatic CPU count scaling for two tests, where that would lead to differences in the gold output.

#1 lore raw

PATCH 1/2 xfs/078: disable all concurrency scaling

Disable concurrency scaling to avoid mismatching output on systems with a large CPU count.

---
 tests/xfs/078 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tests/xfs/078 +5 -3
index 6057aeea12ab..8ef52614b125 100755
@@ -57,9 +57,11 @@ _grow_loop()
 	$XFS_IO_PROG -f -c "truncate $original" $LOOP_IMG
 	loop_dev=`_create_loop_device $LOOP_IMG $bsize`
 
-	dparam=""
+	# Disable concurrency scaling to avoid output differences due to large
+	# CPU counts.
+	mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
 	if [ -n "$agsize" ]; then
-		dparam="-d agsize=$agsize"
+		mkfs_opts="$mkfs_opts -d agsize=$agsize"
 	fi
 
 	echo
@@ -67,7 +69,7 @@ _grow_loop()
 	echo
 
 	echo "*** mkfs loop file (size=$original)"
-	$MKFS_XFS_PROG -b size=$bsize $dparam $loop_dev | \
+	$MKFS_XFS_PROG -b size=$bsize $mkfs_opts $loop_dev | \
 		_filter_mkfs 2>/dev/null
 
 	echo "*** extend loop file"
Signature · 1 line
2.53.0
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] xfs/078: disable all concurrency scaling

Quoted 5 lines · Christoph Hellwig

Disable concurrency scaling to avoid mismatching output on systems with a large CPU count.

I think this papers over what I still feel is a problem in mkfs.xfs behavior, but that's a different issue and making tests pass is good, so:

Quoted 31 lines
---
 tests/xfs/078 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tests/xfs/078 +5 -3
index 6057aeea12ab..8ef52614b125 100755
@@ -57,9 +57,11 @@ _grow_loop()
 	$XFS_IO_PROG -f -c "truncate $original" $LOOP_IMG
 	loop_dev=`_create_loop_device $LOOP_IMG $bsize`
 
-	dparam=""
+	# Disable concurrency scaling to avoid output differences due to large
+	# CPU counts.
+	mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
 	if [ -n "$agsize" ]; then
-		dparam="-d agsize=$agsize"
+		mkfs_opts="$mkfs_opts -d agsize=$agsize"
 	fi
 
 	echo
@@ -67,7 +69,7 @@ _grow_loop()
 	echo
 
 	echo "*** mkfs loop file (size=$original)"
-	$MKFS_XFS_PROG -b size=$bsize $dparam $loop_dev | \
+	$MKFS_XFS_PROG -b size=$bsize $mkfs_opts $loop_dev | \
 		_filter_mkfs 2>/dev/null
 
 	echo "*** extend loop file"
#3 lore raw

Re: [PATCH 1/2] xfs/078: disable all concurrency scaling

Quoted 11 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig

Disable concurrency scaling to avoid mismatching output on systems with a large CPU count.

I think this papers over what I still feel is a problem in mkfs.xfs behavior, but that's a different issue and making tests pass is good, so:

Er, hang on - let me retract that. Lukas sent a series to address this problem too, right, and one of the things he added in his series is a helper to determine whether the concurrency options even exist, so that this can continue to run on older xfsprogs, which seems like a good idea, no?

https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=7f162f5bcf50fc32c7e3b432e7ff189571a3151f

which added _scratch_mkfs_xfs_supports_concurrency()

Quoted 33 lines
Quoted 31 lines
---
 tests/xfs/078 | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
tests/xfs/078 +5 -3
index 6057aeea12ab..8ef52614b125 100755
@@ -57,9 +57,11 @@ _grow_loop()
 	$XFS_IO_PROG -f -c "truncate $original" $LOOP_IMG
 	loop_dev=`_create_loop_device $LOOP_IMG $bsize`
 
-	dparam=""
+	# Disable concurrency scaling to avoid output differences due to large
+	# CPU counts.
+	mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
 	if [ -n "$agsize" ]; then
-		dparam="-d agsize=$agsize"
+		mkfs_opts="$mkfs_opts -d agsize=$agsize"
 	fi
 
 	echo
@@ -67,7 +69,7 @@ _grow_loop()
 	echo
 
 	echo "*** mkfs loop file (size=$original)"
-	$MKFS_XFS_PROG -b size=$bsize $dparam $loop_dev | \
+	$MKFS_XFS_PROG -b size=$bsize $mkfs_opts $loop_dev | \
 		_filter_mkfs 2>/dev/null
 
 	echo "*** extend loop file"
#4 lore raw

Re: [PATCH 1/2] xfs/078: disable all concurrency scaling

Quoted 19 lines · Eric Sandeen
Quoted 11 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig

Disable concurrency scaling to avoid mismatching output on systems with a large CPU count.

I think this papers over what I still feel is a problem in mkfs.xfs behavior, but that's a different issue and making tests pass is good, so:

Er, hang on - let me retract that. Lukas sent a series to address this problem too, right, and one of the things he added in his series is a helper to determine whether the concurrency options even exist, so that this can continue to run on older xfsprogs, which seems like a good idea, no?

Quoted 3 lines

https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=7f162f5bcf50fc32c7e3b432e7ff189571a3151f

which added _scratch_mkfs_xfs_supports_concurrency()

I agree, I think we can add the change below on top of this patch. Regardless of the change, I confirmed that this patch avoids the failure that I reported. Thanks!

tests/xfs/078 +5 -1
index 8ef5261..dc0668e 100755
@@ -59,7 +59,11 @@ _grow_loop()
 
 	# Disable concurrency scaling to avoid output differences due to large
 	# CPU counts.
-	mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
+	if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
+		mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
+	else
+		mkfs_opts=""
+	fi
 	if [ -n "$agsize" ]; then
 		mkfs_opts="$mkfs_opts -d agsize=$agsize"
 	fi
#5 lore raw

Re: [PATCH 1/2] xfs/078: disable all concurrency scaling

Quoted 20 lines · Shin'ichiro Kawasaki
Quoted 19 lines · Eric Sandeen
Quoted 11 lines · Eric Sandeen
Quoted 5 lines · Christoph Hellwig

Disable concurrency scaling to avoid mismatching output on systems with a large CPU count.

I think this papers over what I still feel is a problem in mkfs.xfs behavior, but that's a different issue and making tests pass is good, so:

Er, hang on - let me retract that. Lukas sent a series to address this problem too, right, and one of the things he added in his series is a helper to determine whether the concurrency options even exist, so that this can continue to run on older xfsprogs, which seems like a good idea, no?

Quoted 7 lines
Quoted 3 lines

https://git.kernel.org/pub/scm/fs/xfs/xfstests-dev.git/commit/?h=for-next&id=7f162f5bcf50fc32c7e3b432e7ff189571a3151f

which added _scratch_mkfs_xfs_supports_concurrency()

I agree, I think we can add the change below on top of this patch. Regardless of the change, I confirmed that this patch avoids the failure that I reported. Thanks!

Thanks, I'll add that.

#6 lore raw

PATCH 2/2 xfs/216: disable all concurrency scaling

In reply to Christoph Hellwig

This test currently disables log concurrency scaling, but even the data device concurrency scaling can create mismatching output on systems with a large CPU count.

---
 tests/xfs/216 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xfs/216 +1 -1
index 1749647c11f7..ce8bb528410b 100755
@@ -23,7 +23,7 @@ _cleanup()
 _require_scratch
 _scratch_mkfs_xfs >/dev/null 2>&1
 if _scratch_mkfs_xfs_supports_concurrency -l >> $seqres.full 2>&1; then
-	loop_mkfs_opts="-l concurrency=0"
+	loop_mkfs_opts="-d concurrency=0 -l concurrency=0 -r concurrency=0"
 else
 	loop_mkfs_opts=""
 fi
Signature · 1 line
2.53.0
Tested-by on v1 2/2
#7 lore raw

Re: [PATCH 2/2] xfs/216: disable all concurrency scaling

Quoted 6 lines · Christoph Hellwig

This test currently disables log concurrency scaling, but even the data device concurrency scaling can create mismatching output on systems with a large CPU count.

Thanks, I confirmed this patch avoid the failure that I reported.