From: John Garry <john.g.garry@oracle.com>
To: fio@vger.kernel.org, axboe@kernel.dk
Cc: martin.petersen@oracle.com, djwong@kernel.org, mcgrof@kernel.org,
alan.adamson@oracle.com, david@fromorbit.com,
John Garry <john.g.garry@oracle.com>
Subject: [PATCH v2 8/9] fio: Support verify_write_sequence
Date: Mon, 16 Sep 2024 16:53:46 +0000 [thread overview]
Message-ID: <20240916165347.2226763-9-john.g.garry@oracle.com> (raw)
In-Reply-To: <20240916165347.2226763-1-john.g.garry@oracle.com>
Add an option to disable verifying the write sequence number. By default,
it is enabled. However disable for verify_only mode.
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
HOWTO.rst | 11 +++++++++++
fio.1 | 8 ++++++++
init.c | 3 +++
options.c | 11 +++++++++++
thread_options.h | 1 +
verify.c | 7 ++++---
6 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/HOWTO.rst b/HOWTO.rst
index c6c9b306..4f071484 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -4002,6 +4002,17 @@ Verification
instead resets the file after the write phase and then replays I/Os for
the verification phase.
+.. option:: verify_write_sequence=bool
+
+ Verify the header write sequence number. In a scenario with multiple jobs,
+ verification of the write sequence number may fail. Disabling this option
+ will mean that write sequence number checking is skipped. Doing that can be
+ useful for testing atomic writes, as it means that checksum verification can
+ still be attempted. For when :option:`atomic` is enabled, checksum
+ verification is expected to succeed (while write sequence checking can still
+ fail).
+ Defaults to true.
+
.. option:: trim_percentage=int
Number of verify blocks to discard/trim.
diff --git a/fio.1 b/fio.1
index 6e5bed9d..0fd0fb25 100644
--- a/fio.1
+++ b/fio.1
@@ -3726,6 +3726,14 @@ Enable experimental verification. Standard verify records I/O metadata for
later use during the verification phase. Experimental verify instead resets the
file after the write phase and then replays I/Os for the verification phase.
.TP
+.BI verify_write_sequence \fR=\fPbool
+Verify the header write sequence number. In a scenario with multiple jobs,
+verification of the write sequence number may fail. Disabling this option
+will mean that write sequence number checking is skipped. Doing that can be
+useful for testing atomic writes, as it means that checksum verification can
+still be attempted. For when \fBatomic\fR is enabled, checksum verification
+is expected to succeed (while write sequence checking can still fail).
+.TP
.BI trim_percentage \fR=\fPint
Number of verify blocks to discard/trim.
.TP
diff --git a/init.c b/init.c
index bad8b75b..96a03d98 100644
--- a/init.c
+++ b/init.c
@@ -853,6 +853,9 @@ static int fixup_options(struct thread_data *td)
(o->max_bs[DDIR_WRITE] % o->verify_interval))
o->verify_interval = gcd(o->min_bs[DDIR_WRITE],
o->max_bs[DDIR_WRITE]);
+
+ if (td->o.verify_only)
+ o->verify_write_sequence = 0;
}
if (td->o.oatomic) {
diff --git a/options.c b/options.c
index 95567de6..c35878f7 100644
--- a/options.c
+++ b/options.c
@@ -3397,6 +3397,17 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_VERIFY,
},
+ {
+ .name = "verify_write_sequence",
+ .lname = "Verify write sequence number",
+ .off1 = offsetof(struct thread_options, verify_write_sequence),
+ .type = FIO_OPT_BOOL,
+ .def = "1",
+ .help = "Verify header write sequence number",
+ .parent = "verify",
+ .category = FIO_OPT_C_IO,
+ .group = FIO_OPT_G_VERIFY,
+ },
#ifdef FIO_HAVE_TRIM
{
.name = "trim_percentage",
diff --git a/thread_options.h b/thread_options.h
index ee1e5b31..d0e0a4ae 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -156,6 +156,7 @@ struct thread_options {
unsigned int experimental_verify;
unsigned int verify_state;
unsigned int verify_state_save;
+ unsigned int verify_write_sequence;
unsigned int use_thread;
unsigned int unlink;
unsigned int unlink_each_loop;
diff --git a/verify.c b/verify.c
index b2fede24..f3d228ba 100644
--- a/verify.c
+++ b/verify.c
@@ -848,12 +848,13 @@ static int verify_header(struct io_u *io_u, struct thread_data *td,
/*
* For read-only workloads, the program cannot be certain of the
* last numberio written to a block. Checking of numberio will be
- * done only for workloads that write data. For verify_only,
- * numberio check is skipped.
+ * done only for workloads that write data. For verify_only or
+ * any mode de-selecting verify_write_sequence, numberio check is
+ * skipped.
*/
if (td_write(td) && (td_min_bs(td) == td_max_bs(td)) &&
!td->o.time_based)
- if (!td->o.verify_only)
+ if (td->o.verify_write_sequence)
if (hdr->numberio != io_u->numberio) {
log_err("verify: bad header numberio %"PRIu16
", wanted %"PRIu16,
--
2.31.1
next prev parent reply other threads:[~2024-09-16 16:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-16 16:53 [PATCH v2 0/9] fio: atomic write support John Garry
2024-09-16 16:53 ` [PATCH v2 1/9] os-linux: Define RWF_ATOMIC John Garry
2024-09-16 16:53 ` [PATCH v2 2/9] os: Reintroduce atomic write support John Garry
2024-09-16 16:53 ` [PATCH v2 3/9] pvsync2: Support RWF_ATOMIC John Garry
2024-09-16 16:53 ` [PATCH v2 4/9] libaio: " John Garry
2024-09-16 16:53 ` [PATCH v2 5/9] io_uring: " John Garry
2024-09-16 16:53 ` [PATCH v2 6/9] tools/fiograph: Update for atomic support John Garry
2024-09-16 16:53 ` [PATCH v2 7/9] doc: Document atomic command John Garry
2024-09-16 16:53 ` John Garry [this message]
2024-09-16 16:53 ` [PATCH v2 9/9] examples: Add example for atomic write verify John Garry
2024-09-17 2:23 ` [PATCH v2 0/9] fio: atomic write support Jens Axboe
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=20240916165347.2226763-9-john.g.garry@oracle.com \
--to=john.g.garry@oracle.com \
--cc=alan.adamson@oracle.com \
--cc=axboe@kernel.dk \
--cc=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=fio@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mcgrof@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