From: vincentfu@gmail.com
To: axboe@kernel.dk, fio@vger.kernel.org
Cc: Vincent Fu <vincent.fu@wdc.com>
Subject: [PATCH v2 1/4] fio: add function to check for serialize_overlap with offload submission
Date: Wed, 17 Oct 2018 10:52:22 -0400 [thread overview]
Message-ID: <20181017145225.14546-2-vincentfu@gmail.com> (raw)
In-Reply-To: <20181017145225.14546-1-vincentfu@gmail.com>
From: Vincent Fu <vincent.fu@wdc.com>
In multiple places fio needs to check whether it is carrying out overlap
checking in offload submission mode. Make this check a function to
improve code readability.
---
backend.c | 4 ++--
fio.h | 5 +++++
ioengines.c | 2 +-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/backend.c b/backend.c
index cc3c4e78..f0a45bc8 100644
--- a/backend.c
+++ b/backend.c
@@ -1874,10 +1874,10 @@ static void *thread_main(void *data)
"perhaps try --debug=io option for details?\n",
td->o.name, td->io_ops->name);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_lock(&overlap_check);
td_set_runstate(td, TD_FINISHING);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_unlock(&overlap_check);
update_rusage_stat(td);
diff --git a/fio.h b/fio.h
index e394e165..f46a4c9b 100644
--- a/fio.h
+++ b/fio.h
@@ -772,6 +772,11 @@ static inline bool td_async_processing(struct thread_data *td)
return (td->flags & TD_F_NEED_LOCK) != 0;
}
+static inline bool td_offload_overlap(struct thread_data *td)
+{
+ return (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD);
+}
+
/*
* We currently only need to do locking if we have verifier threads
* accessing our internal structures too
diff --git a/ioengines.c b/ioengines.c
index 47f606a7..56723add 100644
--- a/ioengines.c
+++ b/ioengines.c
@@ -288,7 +288,7 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
assert((io_u->flags & IO_U_F_FLIGHT) == 0);
io_u_set(td, io_u, IO_U_F_FLIGHT);
- if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
+ if (td_offload_overlap(td))
pthread_mutex_unlock(&overlap_check);
assert(fio_file_open(io_u->file));
--
2.17.1
next prev parent reply other threads:[~2018-10-17 14:52 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-17 14:52 [PATCH v2 0/4] cross-job overlap patches vincentfu
2018-10-17 14:52 ` vincentfu [this message]
2018-10-17 15:33 ` [PATCH v2 1/4] fio: add function to check for serialize_overlap with offload submission Sébastien Boisvert
2018-10-17 14:52 ` [PATCH v2 2/4] fio: enable cross-thread overlap checking with processes vincentfu
2018-10-17 15:32 ` Jens Axboe
2018-10-17 14:52 ` [PATCH v2 3/4] fio: document locking for overlap checking in offload mode vincentfu
2018-10-17 14:52 ` [PATCH v2 4/4] docs: serialize_overlap=1 with io_submit_mode=offload no longer requires threads vincentfu
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=20181017145225.14546-2-vincentfu@gmail.com \
--to=vincentfu@gmail.com \
--cc=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=vincent.fu@wdc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox