return 1;
}
-static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
- enum fio_ddir ddir, unsigned long long *b)
+static int __get_next_rand_offset(struct thread_data *td, struct fio_file *f,
+ enum fio_ddir ddir, unsigned long long *b)
{
unsigned long long rmax, r, lastb;
int loops = 5;
return 0;
}
+static int __get_next_rand_offset_zipf(struct thread_data *td,
+ struct fio_file *f, enum fio_ddir ddir,
+ unsigned long long *b)
+{
+ *b = zipf_next(&td->zipf);
+ return 0;
+}
+
+static int __get_next_rand_offset_pareto(struct thread_data *td,
+ struct fio_file *f, enum fio_ddir ddir,
+ unsigned long long *b)
+{
+ *b = pareto_next(&td->zipf);
+ return 0;
+}
+
+static int get_next_rand_offset(struct thread_data *td, struct fio_file *f,
+ enum fio_ddir ddir, unsigned long long *b)
+{
+ if (td->o.random_distribution == FIO_RAND_DIST_RANDOM)
+ return __get_next_rand_offset(td, f, ddir, b);
+ else if (td->o.random_distribution == FIO_RAND_DIST_ZIPF)
+ return __get_next_rand_offset_zipf(td, f, ddir, b);
+ else if (td->o.random_distribution == FIO_RAND_DIST_PARETO)
+ return __get_next_rand_offset_pareto(td, f, ddir, b);
+
+ log_err("fio: unknown random distribution: %d\n", td->o.random_distribution);
+ return 1;
+}
+
static int get_next_rand_block(struct thread_data *td, struct fio_file *f,
enum fio_ddir ddir, unsigned long long *b)
{
io_u->error = 0;
flist_del(&io_u->list);
- flist_add(&io_u->list, &td->io_u_busylist);
+ flist_add_tail(&io_u->list, &td->io_u_busylist);
td->cur_depth++;
io_u->flags |= IO_U_F_IN_CUR_DEPTH;
} else if (td->o.verify_async) {
void io_u_log_error(struct thread_data *td, struct io_u *io_u)
{
+ enum error_type_bit eb = td_error_type(io_u->ddir, io_u->error);
const char *msg[] = { "read", "write", "sync", "datasync",
"sync_file_range", "wait", "trim" };
-
+ if (td_non_fatal_error(td, eb, io_u->error) && !td->o.error_dump)
+ return;
log_err("fio: io_u error");
tusec = utime_since(&io_u->start_time, &icd->time);
add_lat_sample(td, idx, tusec, bytes);
+
+ if (td->o.max_latency && tusec > td->o.max_latency) {
+ if (!td->error)
+ log_err("fio: latency of %lu usec exceeds specified max (%u usec)\n", tusec, td->o.max_latency);
+ td_verror(td, ETIME, "max latency exceeded");
+ icd->error = ETIME;
+ }
}
if (!td->o.disable_clat) {
icd->error = io_u->error;
io_u_log_error(td, io_u);
}
- if (icd->error && td_non_fatal_error(icd->error) &&
- (td->o.continue_on_error & td_error_type(io_u->ddir, icd->error))) {
+ if (icd->error) {
+ enum error_type_bit eb = td_error_type(io_u->ddir, icd->error);
+ if (!td_non_fatal_error(td, eb, icd->error))
+ return;
/*
* If there is a non_fatal error, then add to the error count
* and clear all the errors.