uint64_t bytes_done[DDIR_RWDIR_CNT] = { 0, 0, 0 };
unsigned int i;
int ret = 0;
+ uint64_t bytes_issued = 0;
if (in_ramp_time(td))
td_set_runstate(td, TD_RAMP);
if (flow_threshold_exceeded(td))
continue;
+ if (bytes_issued >= (uint64_t) td->o.size)
+ break;
+
io_u = get_io_u(td);
if (!io_u)
break;
int bytes = io_u->xfer_buflen - io_u->resid;
struct fio_file *f = io_u->file;
+ bytes_issued += bytes;
/*
* zero read, fail
*/
ret = io_u_sync_complete(td, io_u, bytes_done);
if (ret < 0)
break;
+ bytes_issued += io_u->xfer_buflen;
}
break;
case FIO_Q_QUEUED:
*/
if (td->io_ops->commit == NULL)
io_u_queued(td, io_u);
+ bytes_issued += io_u->xfer_buflen;
break;
case FIO_Q_BUSY:
requeue_io_u(td, &io_u);
* overflow later. this adjustment may be too much if we get
* lucky and the allocator gives us an aligned address.
*/
- if (td->o.odirect || td->o.mem_align || (td->io_ops->flags & FIO_RAWIO))
+ if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
+ (td->io_ops->flags & FIO_RAWIO))
td->orig_buffer_size += page_mask + td->o.mem_align;
if (td->o.mem_type == MEM_SHMHUGE || td->o.mem_type == MEM_MMAPHUGE) {
if (data_xfer && allocate_io_mem(td))
return 1;
- if (td->o.odirect || td->o.mem_align ||
+ if (td->o.odirect || td->o.mem_align || td->o.oatomic ||
(td->io_ops->flags & FIO_RAWIO))
p = PAGE_ALIGN(td->orig_buffer) + td->o.mem_align;
else
} else
td->pid = gettid();
+ /*
+ * fio_time_init() may not have been called yet if running as a server
+ */
+ fio_time_init();
+
fio_local_clock_init(o->use_thread);
dprint(FD_PROCESS, "jobs pid=%d started\n", (int) td->pid);
if (fio_gtod_offload && fio_start_gtod_thread())
return;
-
+
fio_idle_prof_init();
set_sig_handlers();