* The main verify engine. Runs over the writes we previously submitted,
* reads the blocks back in, and checks the crc/md5 of the data.
*/
-static void do_verify(struct thread_data *td)
+static void do_verify(struct thread_data *td, uint64_t verify_bytes)
{
struct fio_file *f;
struct io_u *io_u;
int ret, min_events;
+ uint64_t io_bytes;
unsigned int i;
dprint(FD_VERIFY, "starting loop\n");
td_set_runstate(td, TD_VERIFYING);
io_u = NULL;
+ io_bytes = 0;
while (!td->terminate) {
enum fio_ddir ddir;
int ret2, full;
if (flow_threshold_exceeded(td))
continue;
- io_u = __get_io_u(td);
- if (!io_u)
- break;
+ if (!td->o.experimental_verify) {
+ io_u = __get_io_u(td);
+ if (!io_u)
+ break;
- if (get_next_verify(td, io_u)) {
- put_io_u(td, io_u);
- break;
- }
+ if (get_next_verify(td, io_u)) {
+ put_io_u(td, io_u);
+ break;
+ }
- if (td_io_prep(td, io_u)) {
- put_io_u(td, io_u);
- break;
+ if (td_io_prep(td, io_u)) {
+ put_io_u(td, io_u);
+ break;
+ }
+ } else {
+ io_u = get_io_u(td);
+ if (!io_u)
+ break;
+
+ if (io_u->buflen + io_bytes > verify_bytes)
+ break;
}
if (td->o.verify_async)
io_u->xfer_buflen = io_u->resid;
io_u->xfer_buf += bytes;
io_u->offset += bytes;
+ io_bytes += bytes;
if (ddir_rw(io_u->ddir))
td->ts.short_io_u[io_u->ddir]++;
if (ret < 0)
break;
}
+ io_bytes += io_u->xfer_buflen;
continue;
case FIO_Q_QUEUED:
break;
min_events = 1;
do {
+ unsigned long bytes = 0;
+
/*
* Reap required number of io units, if any,
* and do the verification on them through
* the callback handler
*/
- if (io_u_queued_complete(td, min_events, NULL) < 0) {
+ if (io_u_queued_complete(td, min_events, &bytes) < 0) {
ret = -1;
break;
}
+ io_bytes += bytes;
} while (full && (td->cur_depth > td->o.iodepth_low));
}
if (ret < 0)
clear_state = 0;
while (keep_running(td)) {
+ uint64_t write_bytes;
+
fio_gettime(&td->start, NULL);
memcpy(&td->bw_sample_time, &td->start, sizeof(td->start));
memcpy(&td->iops_sample_time, &td->start, sizeof(td->start));
prune_io_piece_log(td);
+ write_bytes = td->io_bytes[DDIR_WRITE];
do_io(td);
+ write_bytes = td->io_bytes[DDIR_WRITE] - write_bytes;
clear_state = 1;
fio_gettime(&td->start, NULL);
- do_verify(td);
+ do_verify(td, write_bytes);
td->ts.runtime[DDIR_READ] += utime_since_now(&td->start);
* any stored write metadata, just return a random offset
*/
if (!td->o.verifysort_nr || !(ddir == DDIR_READ && td->o.do_verify &&
- td->o.verify != VERIFY_NONE && td_random(td)))
+ td->o.verify != VERIFY_NONE && td_random(td)) ||
+ td->o.random_generator == FIO_RAND_GEN_TAUSWORTHE)
return get_off_from_method(td, f, ddir, b);
if (!flist_empty(&td->next_rand_list)) {
{
enum fio_ddir ddir;
+ /*
+ * If verify phase started, it's always a READ
+ */
+ if (td->runstate == TD_VERIFYING)
+ return DDIR_READ;
+
/*
* see if it's time to fsync
*/
if (td_write(td) && idx == DDIR_WRITE &&
td->o.do_verify &&
- td->o.verify != VERIFY_NONE)
+ td->o.verify != VERIFY_NONE &&
+ !td->o.experimental_verify)
log_io_piece(td, io_u);
icd->bytes_done[idx] += bytes;