FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] xfs: test online repair when xfiles consists of THPs
@ 2024-08-06 22:55 Darrick J. Wong
  2024-08-07 16:14 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2024-08-06 22:55 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, xfs

From: Darrick J. Wong <djwong@kernel.org>

Fork xfs/286 so that we can ensure that the xfile and xmbuf code in
fsck can handle THPs and large folios.  This actually caused a
regression in the mm code during 6.10.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/1877     |   76 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/xfs/1877.out |    2 +
 2 files changed, 78 insertions(+)
 create mode 100755 tests/xfs/1877
 create mode 100644 tests/xfs/1877.out

diff --git a/tests/xfs/1877 b/tests/xfs/1877
new file mode 100755
index 0000000000..e546ad854f
--- /dev/null
+++ b/tests/xfs/1877
@@ -0,0 +1,76 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2017 Oracle, Inc.  All Rights Reserved.
+#
+# FS QA Test No. 1877
+#
+# Force-enable THPs/large folios in tmpfs, then race fsstress and xfs_scrub in
+# force-repair mode for a while to see if we crash, livelock, or corrupt data
+# because the xfile code wasn't folioized.
+#
+. ./common/preamble
+_begin_fstest online_repair dangerous_fsstress_repair
+
+declare -A oldvalues
+
+_cleanup() {
+	cd /
+	for knob in "${!oldvalues[@]}"; do
+		echo "${oldvalues["$knob"]}" > "$knob"
+	done
+
+	_scratch_xfs_stress_scrub_cleanup &> /dev/null
+	rm -r -f $tmp.*
+}
+_register_cleanup "_cleanup" BUS
+
+. ./common/filter
+. ./common/fuzzy
+. ./common/inject
+. ./common/xfs
+
+_require_scratch
+_require_xfs_stress_online_repair
+
+_fixed_by_git_commit kernel 099d90642a711 \
+	"mm/filemap: make MAX_PAGECACHE_ORDER acceptable to xarray"
+
+# Make sure that the xfile code can handle large folios
+knob="/sys/kernel/mm/transparent_hugepage/shmem_enabled"
+test -w "$knob" || _notrun "tmpfs transparent hugepages disabled"
+
+pagesize=`getconf PAGE_SIZE`
+pagesize_kb=$((pagesize / 1024))
+
+echo "settings now: pagesize=${pagesize_kb}KB" >> $seqres.full
+sysfs-dump /sys/kernel/mm/transparent_hugepage/* >> $seqres.full
+
+# Enable large folios for each of the relevant page sizes.
+for ((i = 0; i <= 31; i++)); do
+	hugepagesize_kb=$(( pagesize_kb * (2**i) ))
+	knob="/sys/kernel/mm/transparent_hugepage/hugepages-${hugepagesize_kb}kB/enabled"
+	test -e "$knob" || continue
+
+	echo "setting $knob to inherit" >> $seqres.full
+	oldvalue="$(sed -e 's/^.*\[//g' -e 's/\].*$//g' < "$knob")"
+	oldvalues["$knob"]="$oldvalue"
+	echo inherit > "$knob"
+done
+
+# Turn on large folios
+knob="/sys/kernel/mm/transparent_hugepage/shmem_enabled"
+echo "setting $knob to force" >> $seqres.full
+oldvalues["$knob"]="$(sed -e 's/^.*\[//g' -e 's/\].*$//g' < "$knob")"
+echo force > "$knob" || _fail "could not force tmpfs transparent hugepages"
+
+echo "settings now" >> $seqres.full
+sysfs-dump /sys/kernel/mm/transparent_hugepage/* >> $seqres.full
+
+_scratch_mkfs >> "$seqres.full" 2>&1
+_scratch_mount
+_scratch_xfs_stress_online_repair -S '-k'
+
+# success, all done
+echo Silence is golden
+status=0
+exit
diff --git a/tests/xfs/1877.out b/tests/xfs/1877.out
new file mode 100644
index 0000000000..88d845a112
--- /dev/null
+++ b/tests/xfs/1877.out
@@ -0,0 +1,2 @@
+QA output created by 1877
+Silence is golden

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] xfs: test online repair when xfiles consists of THPs
  2024-08-06 22:55 [PATCH] xfs: test online repair when xfiles consists of THPs Darrick J. Wong
@ 2024-08-07 16:14 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2024-08-07 16:14 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Zorro Lang, fstests, xfs

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-08-07 16:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06 22:55 [PATCH] xfs: test online repair when xfiles consists of THPs Darrick J. Wong
2024-08-07 16:14 ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox