X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=workqueue.c;h=27d1060c6e6f2b1cd6710d540e63e9b0c621691c;hp=e2365167a9b52d3f429da56c8cd26d377122d362;hb=40649b005743e98d460edd8c570e238ded14f0a5;hpb=50a8ce864e2c5bee7c44935b39b357aa8071615b diff --git a/workqueue.c b/workqueue.c index e2365167..27d1060c 100644 --- a/workqueue.c +++ b/workqueue.c @@ -79,7 +79,7 @@ static struct submit_worker *get_submit_worker(struct workqueue *wq) return sw; } -static int all_sw_idle(struct workqueue *wq) +static bool all_sw_idle(struct workqueue *wq) { int i; @@ -87,10 +87,10 @@ static int all_sw_idle(struct workqueue *wq) struct submit_worker *sw = &wq->workers[i]; if (!(sw->flags & SW_F_IDLE)) - return 0; + return false; } - return 1; + return true; } /* @@ -162,6 +162,7 @@ static int init_submit_worker(struct submit_worker *sw) memcpy(&td->ts, &parent->ts, sizeof(td->ts)); td->o.uid = td->o.gid = -1U; dup_files(td, parent); + td->eo = parent->eo; fio_options_mem_dupe(td); if (ioengine_load(td)) @@ -185,7 +186,7 @@ static int init_submit_worker(struct submit_worker *sw) fio_gettime(&td->epoch, NULL); fio_getrusage(&td->ru_start); - clear_io_state(td); + clear_io_state(td, 1); td_set_runstate(td, TD_RUNNING); td->flags |= TD_F_CHILD; @@ -282,8 +283,12 @@ static void *worker_thread(void *data) if (td->io_u_queued || td->cur_depth || td->io_u_in_flight) { + int ret; + pthread_mutex_unlock(&sw->lock); - io_u_quiesce(td); + ret = io_u_quiesce(td); + if (ret > 0) + td->cur_depth -= ret; pthread_mutex_lock(&sw->lock); }