static inline void td_set_runstate(struct thread_data *td, int 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);
/*
* if the thread is running, just let it exit
*/
}
}
+ if (td->o.fill_device && td->error == ENOSPC) {
+ td->error = 0;
+ td->terminate = 1;
+ }
if (!td->error) {
struct fio_file *f;
}
} 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)
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)
td->pid = getpid();
+ dprint(FD_PROCESS, "jobs pid=%d started\n", td->pid);
+
INIT_LIST_HEAD(&td->io_u_freelist);
INIT_LIST_HEAD(&td->io_u_busylist);
INIT_LIST_HEAD(&td->io_u_requeues);
if (td->o.use_thread) {
long ret;
- if (pthread_join(td->thread, (void *) &ret))
+ dprint(FD_PROCESS, "joining tread %d\n", td->pid);
+ if (pthread_join(td->thread, (void *) &ret)) {
+ dprint(FD_PROCESS, "join failed %ld\n", ret);
perror("pthread_join");
+ }
}
(*nr_running)--;
nr_started++;
if (td->o.use_thread) {
+ dprint(FD_PROCESS, "will pthread_create\n");
if (pthread_create(&td->thread, NULL, thread_main, td)) {
perror("thread_create");
nr_started--;
break;
}
} else {
+ dprint(FD_PROCESS, "will fork\n");
if (!fork()) {
int ret = fork_main(shm_id, i);