FS/XFS testing framework
 help / color / mirror / Atom feed
From: Jan Prusakowski <jprusakowski@google.com>
To: Zorro Lang <zlang@kernel.org>, Chao Yu <chao@kernel.org>,
	fstests@vger.kernel.org
Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net,
	 Jan Prusakowski <jprusakowski@google.com>
Subject: [PATCH] generic/622: increase sleep time for lazytime expiration on compressed f2fs
Date: Thu,  8 Oct 2026 09:33:17 +0000	[thread overview]
Message-ID: <20261008093317.2792726-1-jprusakowski@google.com> (raw)

In generic/622, expire_timestamps() tests whether lazytime timestamp
updates are persisted after dirtytime expiration. It configures
dirtytime_expire_seconds to 1 second and enables continuous writeback
of dirty inodes, followed by sleeping for 2 seconds to allow the
asynchronous VFS flusher thread to expire the I_DIRTY_TIME inode,
invoke the filesystem's write_inode callback, and flush the dirty
metadata before the test executes _scratch_shutdown -f.

However, on F2FS with transparent compression enabled, compressed files
cannot use inline data and writes use out-of-place updates (OPU) with
higher latency in the compression and writeback pipeline. Because the
inode is only eligible for expiration after 1 second, only about 1 second
remains in the 2-second sleep window for the flusher thread to schedule,
expire the inode, and mark the inode page dirty before
restore_expiration_settings resets dirtytime_expire_seconds to 24 hours
and shutdown occurs. If the flusher thread is delayed, the subsequent
shutdown checkpoint ignores the unexpired I_DIRTY_TIME inode, causing
the test to intermittently fail with:

    FAIL: lazytime mtime wasn't persisted by expiration
    ondisk_time (...) != expected_time (...)

Increase the sleep duration in expire_timestamps() from 2 to 4 seconds
when running on F2FS in compress mode to give sufficient margin for the
flusher thread to reliably expire the lazytime inode and dirty the inode
page before shutdown.

Change-Id: I208bf14c189b54cc209059b0fd2de9e403a073f2
Signed-off-by: Jan Prusakowski <jprusakowski@google.com>
---
 tests/generic/622 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/generic/622 b/tests/generic/622
index e8ead300..5879e85e 100755
--- a/tests/generic/622
+++ b/tests/generic/622
@@ -60,8 +60,14 @@ expire_timestamps()
 	__expire_inodes
 
 	# Userspace doesn't have direct visibility into when inodes are dirty,
-	# so the best we can do is sleep for a couple seconds.
-	sleep 2
+	# so the best we can do is sleep for a couple seconds.  On F2FS with
+	# compression enabled, out-of-place updates and compression writeback
+	# add extra latency, so sleep a bit longer.
+	if [[ "$FSTYP" == "f2fs" && "$MOUNT_OPTIONS" == *compress* ]]; then
+		sleep 4
+	else
+		sleep 2
+	fi
 	restore_expiration_settings
 }
 
-- 
2.55.0.1082.g2b9226bbc0-goog


             reply	other threads:[~2026-10-08  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-08  9:33 Jan Prusakowski [this message]
2026-10-08  9:37 ` [PATCH] generic/622: increase sleep time for lazytime expiration on compressed f2fs Christoph Hellwig
2026-10-08  9:53   ` Jan Prusakowski

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=20261008093317.2792726-1-jprusakowski@google.com \
    --to=jprusakowski@google.com \
    --cc=chao@kernel.org \
    --cc=fstests@vger.kernel.org \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=zlang@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox