static inline void td_set_runstate(struct thread_data *td, int runstate)
{
- dprint(FD_PROCESS, "%d: runstate %d -> %d\n", td->pid, td->runstate,
- runstate);
+ dprint(FD_PROCESS, "pid=%d: runstate %d -> %d\n", td->pid, td->runstate,
+ runstate);
td->runstate = runstate;
}
for_each_td(td, i) {
if (group_id == TERMINATE_ALL || groupid == td->groupid) {
dprint(FD_PROCESS, "setting terminate on %d\n",td->pid);
+
+ td->terminate = 1;
+ td->o.start_delay = 0;
+
/*
* if the thread is running, just let it exit
*/
if (td->runstate < TD_RUNNING)
kill(td->pid, SIGQUIT);
- td->terminate = 1;
- td->o.start_delay = 0;
+ else if (td->io_ops->flags & FIO_SIGQUIT)
+ kill(td->pid, SIGQUIT);
}
}
}
}
}
- /*
- * stop job if we failed doing any IO
- */
- if ((td->this_io_bytes[0] + td->this_io_bytes[1]) == 0)
- td->done = 1;
-
if (td->o.fill_device && td->error == ENOSPC) {
td->error = 0;
td->terminate = 1;
}
} else
cleanup_pending_aio(td);
+
+ /*
+ * stop job if we failed doing any IO
+ */
+ if ((td->this_io_bytes[0] + td->this_io_bytes[1]) == 0)
+ td->done = 1;
}
static void cleanup_io_u(struct thread_data *td)
int i, max_units;
char *p;
- if (td->io_ops->flags & FIO_SYNCIO)
- max_units = 1;
- else
- max_units = td->o.iodepth;
-
+ max_units = td->o.iodepth;
max_bs = max(td->o.max_bs[DDIR_READ], td->o.max_bs[DDIR_WRITE]);
td->orig_buffer_size = (unsigned long long) max_bs * (unsigned long long) max_units;
td->last_was_sync = 0;
- if (td->o.time_based)
+ /*
+ * reset file done count if we are to start over
+ */
+ if (td->o.time_based || td->o.loops)
td->nr_done_files = 0;
for_each_file(td, f, i)