X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=backend.c;h=cc3c4e78e9d8ae6b8fd9cdc245272fc395369f34;hp=bb8bd13bd11f973e616fd3897483e27ec833cbc5;hb=029e6147e9005ddb08774193aa8b3a01174007b1;hpb=e26029be10ee2c570cba2c4cc2b1987568306cd2 diff --git a/backend.c b/backend.c index bb8bd13b..cc3c4e78 100644 --- a/backend.c +++ b/backend.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "fio.h" #include "smalloc.h" @@ -53,7 +54,7 @@ static struct fio_sem *startup_sem; static struct flist_head *cgroup_list; static struct cgroup_mnt *cgroup_mnt; static int exit_value; -static volatile int fio_abort; +static volatile bool fio_abort; static unsigned int nr_process = 0; static unsigned int nr_thread = 0; @@ -65,6 +66,7 @@ unsigned int stat_number = 0; int shm_id = 0; int temp_stall_ts; unsigned long done_secs = 0; +pthread_mutex_t overlap_check = PTHREAD_MUTEX_INITIALIZER; #define JOB_START_TIMEOUT (5 * 1000) @@ -567,7 +569,7 @@ static int unlink_all_files(struct thread_data *td) /* * Check if io_u will overlap an in-flight IO in the queue */ -static bool in_flight_overlap(struct io_u_queue *q, struct io_u *io_u) +bool in_flight_overlap(struct io_u_queue *q, struct io_u *io_u) { bool overlap; struct io_u *check_io_u; @@ -1872,7 +1874,11 @@ 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) + pthread_mutex_lock(&overlap_check); td_set_runstate(td, TD_FINISHING); + if (td->o.serialize_overlap && td->o.io_submit_mode == IO_MODE_OFFLOAD) + pthread_mutex_unlock(&overlap_check); update_rusage_stat(td); td->ts.total_run_time = mtime_since_now(&td->epoch); @@ -2371,7 +2377,7 @@ reap: if (fio_sem_down_timeout(startup_sem, 10000)) { log_err("fio: job startup hung? exiting.\n"); fio_terminate_threads(TERMINATE_ALL); - fio_abort = 1; + fio_abort = true; nr_started--; free(fd); break;