public inbox for fio@vger.kernel.org
 help / color / mirror / Atom feed
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 3/9] pvsync2: Support RWF_ATOMIC
Date: Mon, 16 Sep 2024 16:53:41 +0000	[thread overview]
Message-ID: <20240916165347.2226763-4-john.g.garry@oracle.com> (raw)
In-Reply-To: <20240916165347.2226763-1-john.g.garry@oracle.com>

From: Alan Adamson <alan.adamson@oracle.com>

Set RWF_ATOMIC for writes and atomic==1.

Signed-off-by: Alan Adamson <alan.adamson@oracle.com>
jpg: Set FIO_ATOMICWRITES for pvsync2
Signed-off-by: John Garry <john.g.garry@oracle.com>
---
 engines/sync.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/engines/sync.c b/engines/sync.c
index b8be4eb3..729d8a71 100644
--- a/engines/sync.c
+++ b/engines/sync.c
@@ -175,9 +175,11 @@ static enum fio_q_status fio_pvsyncio2_queue(struct thread_data *td,
 
 	if (io_u->ddir == DDIR_READ)
 		ret = preadv2(f->fd, iov, 1, io_u->offset, flags);
-	else if (io_u->ddir == DDIR_WRITE)
+	else if (io_u->ddir == DDIR_WRITE) {
+		if (td->o.oatomic)
+			flags |= RWF_ATOMIC;
 		ret = pwritev2(f->fd, iov, 1, io_u->offset, flags);
-	else if (io_u->ddir == DDIR_TRIM) {
+	} else if (io_u->ddir == DDIR_TRIM) {
 		do_io_u_trim(td, io_u);
 		return FIO_Q_COMPLETED;
 	} else
@@ -476,7 +478,8 @@ static struct ioengine_ops ioengine_pvrw2 = {
 	.open_file	= generic_open_file,
 	.close_file	= generic_close_file,
 	.get_file_size	= generic_get_file_size,
-	.flags		= FIO_SYNCIO,
+	.flags		= FIO_SYNCIO |
+			  FIO_ATOMICWRITES,
 	.options	= options,
 	.option_struct_size	= sizeof(struct psyncv2_options),
 };
-- 
2.31.1


  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 ` John Garry [this message]
2024-09-16 16:53 ` [PATCH v2 4/9] libaio: Support RWF_ATOMIC 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 ` [PATCH v2 8/9] fio: Support verify_write_sequence John Garry
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-4-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