All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org, guaneryu@gmail.com, zlang@redhat.com
Cc: linux-xfs@vger.kernel.org, fstests@vger.kernel.org, guan@eryu.me
Subject: [PATCH 8/9] xfs/166: fix golden output failures when multipage folios enabled
Date: Tue, 28 Jun 2022 13:22:02 -0700	[thread overview]
Message-ID: <165644772249.1045534.3583119178643533811.stgit@magnolia> (raw)
In-Reply-To: <165644767753.1045534.18231838177395571946.stgit@magnolia>

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

Beginning with 5.18, some filesystems support creating large folios for
the page cache.  A system with 64k pages can create 256k folios, which
means that with the old file size of 1M, the last half of the file is
completely converted from unwritten to written by page_mkwrite.  The
test encodes a translated version of the xfs_bmap output in the golden
output, which means that the test now fails on 64k pages.  Fixing the
64k page case by increasing the file size to 2MB broke fsdax because
fsdax uses 2MB PMDs, hence 12MB.

Increase the size to prevent this from happening.  This may require
further revision if folios get larger or fsdax starts supporting PMDs
that are larger than 2MB.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/166 |   19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)


diff --git a/tests/xfs/166 b/tests/xfs/166
index 42379961..d45dc5e8 100755
--- a/tests/xfs/166
+++ b/tests/xfs/166
@@ -16,12 +16,12 @@ _begin_fstest rw metadata auto quick
 # the others are unwritten.
 _filter_blocks()
 {
-	$AWK_PROG '
+	$AWK_PROG -v file_size=$FILE_SIZE '
 /^ +[0-9]/ {
 	if (!written_size) {
 		written_size = $6
-		unwritten1 = ((1048576/512) / 2) - written_size
-		unwritten2 = ((1048576/512) / 2) - 2 * written_size
+		unwritten1 = ((file_size/512) / 2) - written_size
+		unwritten2 = ((file_size/512) / 2) - 2 * written_size
 	}
 
 	# is the extent unwritten?
@@ -58,7 +58,18 @@ _scratch_mount
 
 TEST_FILE=$SCRATCH_MNT/test_file
 TEST_PROG=$here/src/unwritten_mmap
-FILE_SIZE=1048576
+
+# Beginning with 5.18, some filesystems support creating large folios for the
+# page cache.  A system with 64k pages can create 256k folios, which means
+# that with the old file size of 1M, the last half of the file is completely
+# converted from unwritten to written by page_mkwrite.  The test will fail on
+# the golden output when this happens, so increase the size from the original
+# 1MB file size to at least (6 * 256k == 1.5MB) prevent this from happening.
+#
+# However, increasing the file size to around 2MB causes regressions when fsdax
+# is enabled because fsdax will try to use PMD entries for the mappings.  Hence
+# we need to set the file size to (6 * 2MB == 12MB) to cover all cases.
+FILE_SIZE=$((12 * 1048576))
 
 rm -f $TEST_FILE
 $TEST_PROG $FILE_SIZE $TEST_FILE


  parent reply	other threads:[~2022-06-28 20:25 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-28 20:21 [PATCHSET 0/9] fstests: random fixes Darrick J. Wong
2022-06-28 20:21 ` [PATCH 1/9] seek_sanity_test: fix allocation unit detection on XFS realtime Darrick J. Wong
2022-06-29  7:41   ` Christoph Hellwig
2022-07-28  1:37   ` liuyd.fnst
2022-07-28  2:31     ` Darrick J. Wong
2022-07-28  2:37     ` Darrick J. Wong
2022-07-28  3:38       ` liuyd.fnst
2022-07-28  3:54         ` Darrick J. Wong
2022-06-28 20:21 ` [PATCH 2/9] xfs/070: filter new superblock verifier messages Darrick J. Wong
2022-06-29  4:15   ` Dave Chinner
2022-06-29  9:12     ` Zorro Lang
2022-06-29 22:41       ` Darrick J. Wong
2022-06-30  2:18         ` Zorro Lang
2022-06-28 20:21 ` [PATCH 3/9] xfs: test mkfs.xfs sizing of internal logs that Darrick J. Wong
2022-06-29  4:18   ` Dave Chinner
2022-06-29 22:43     ` Darrick J. Wong
2022-06-30  6:37       ` Zorro Lang
2022-06-30 19:32         ` Darrick J. Wong
2022-06-28 20:21 ` [PATCH 4/9] xfs: test xfs_copy doesn't do cached read before libxfs_mount Darrick J. Wong
2022-06-29  4:20   ` Dave Chinner
2022-06-29 22:46     ` Darrick J. Wong
2022-06-30  0:48   ` [PATCH v2.1 " Darrick J. Wong
2022-07-01  1:06     ` Dave Chinner
2022-06-28 20:21 ` [PATCH 5/9] check: document mkfs.xfs reliance on fstests exports Darrick J. Wong
2022-06-29  4:22   ` Dave Chinner
2022-06-28 20:21 ` [PATCH 6/9] xfs/109: handle larger minimum filesystem size Darrick J. Wong
2022-06-29  4:22   ` Dave Chinner
2022-06-28 20:21 ` [PATCH 7/9] xfs/018: fix LARP testing for small block sizes Darrick J. Wong
2022-06-28 20:22 ` Darrick J. Wong [this message]
2022-06-29  4:23   ` [PATCH 8/9] xfs/166: fix golden output failures when multipage folios enabled Dave Chinner
2022-06-28 20:22 ` [PATCH 9/9] xfs/547: fix problems with realtime Darrick J. Wong
2022-07-05 14:28 ` [PATCHSET 0/9] fstests: random fixes Zorro Lang
2022-07-05 22:04   ` Darrick J. Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=165644772249.1045534.3583119178643533811.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=guan@eryu.me \
    --cc=guaneryu@gmail.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.