Skip to content

Commit 1368d95

Browse files
vincentkfuaxboe
authored andcommitted
fio: add function to check for serialize_overlap with offload submission
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. Reviewed-by: Sebastien Boisvert <sboisvert@gydle.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 029e614 commit 1368d95

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

backend.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1874,10 +1874,10 @@ static void *thread_main(void *data)
18741874
"perhaps try --debug=io option for details?\n",
18751875
td->o.name, td->io_ops->name);
18761876

1877-
if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
1877+
if (td_offload_overlap(td))
18781878
pthread_mutex_lock(&overlap_check);
18791879
td_set_runstate(td, TD_FINISHING);
1880-
if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
1880+
if (td_offload_overlap(td))
18811881
pthread_mutex_unlock(&overlap_check);
18821882

18831883
update_rusage_stat(td);

fio.h

+5
Original file line numberDiff line numberDiff line change
@@ -772,6 +772,11 @@ static inline bool td_async_processing(struct thread_data *td)
772772
return (td->flags & TD_F_NEED_LOCK) != 0;
773773
}
774774

775+
static inline bool td_offload_overlap(struct thread_data *td)
776+
{
777+
return td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD;
778+
}
779+
775780
/*
776781
* We currently only need to do locking if we have verifier threads
777782
* accessing our internal structures too

ioengines.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ enum fio_q_status td_io_queue(struct thread_data *td, struct io_u *io_u)
288288

289289
assert((io_u->flags & IO_U_F_FLIGHT) == 0);
290290
io_u_set(td, io_u, IO_U_F_FLIGHT);
291-
if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD)
291+
if (td_offload_overlap(td))
292292
pthread_mutex_unlock(&overlap_check);
293293

294294
assert(fio_file_open(io_u->file));

0 commit comments

Comments
 (0)