#endif
static int str_exitall_cb(void);
static int str_cpumask_cb(void *, unsigned int *);
+static int str_file_service_cb(void *, const char *);
#define __stringify_1(x) #x
#define __stringify(x) __stringify_1(x)
.help = "Amount of IO buffers to keep in flight",
.def = "1",
},
+ {
+ .name = "iodepth_low",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(iodepth_low),
+ .help = "Low water mark for queuing depth",
+ },
{
.name = "size",
.type = FIO_OPT_STR_VAL,
.help = "Split job workload between this number of files",
.def = "1",
},
+ {
+ .name = "file_service_type",
+ .type = FIO_OPT_STR,
+ .cb = str_file_service_cb,
+ .help = "How to select which file to service next",
+ .def = "roundrobin",
+ .posval = { "random", "roundrobin" },
+ },
{
.name = "fsync",
.type = FIO_OPT_INT,
*/
if (td->thinktime_spin > td->thinktime)
td->thinktime_spin = td->thinktime;
+
+ /*
+ * The low water mark cannot be bigger than the iodepth
+ */
+ if (td->iodepth_low > td->iodepth || !td->iodepth_low)
+ td->iodepth_low = td->iodepth;
}
/*
if (td->directory && td->directory[0] != '\0') {
if (lstat(td->directory, &sb) < 0) {
log_err("fio: %s is not a directory\n", td->directory);
- td_verror(td, errno);
+ td_verror(td, errno, "lstat");
return 1;
}
if (!S_ISDIR(sb.st_mode)) {
*/
int init_random_state(struct thread_data *td)
{
- unsigned long seeds[4];
+ unsigned long seeds[5];
int fd, num_maps, blocks, i;
struct fio_file *f;
fd = open("/dev/urandom", O_RDONLY);
if (fd == -1) {
- td_verror(td, errno);
+ td_verror(td, errno, "open");
return 1;
}
if (read(fd, seeds, sizeof(seeds)) < (int) sizeof(seeds)) {
- td_verror(td, EIO);
+ td_verror(td, EIO, "read");
close(fd);
return 1;
}
os_random_seed(seeds[0], &td->bsrange_state);
os_random_seed(seeds[1], &td->verify_state);
os_random_seed(seeds[2], &td->rwmix_state);
+ os_random_seed(seeds[3], &td->next_file_state);
if (td->sequential)
return 0;
if (td->rand_repeatable)
- seeds[3] = FIO_RANDSEED * td->thread_number;
+ seeds[4] = FIO_RANDSEED * td->thread_number;
if (!td->norandommap) {
for_each_file(td, f, i) {
}
}
- os_random_seed(seeds[3], &td->random_state);
+ os_random_seed(seeds[4], &td->random_state);
return 0;
}
if (td->io_ops)
return 0;
- log_err("fio: ioengine= libaio, posixaio, sync, mmap, sgio, splice, cpu, null\n");
+ log_err("fio: ioengine= libaio, posixaio, sync, syslet-rw, mmap, sgio, splice, cpu, null\n");
log_err("fio: or specify path to dynamic ioengine module\n");
return 1;
}
return 0;
}
+static int str_file_service_cb(void *data, const char *str)
+{
+ struct thread_data *td = data;
+
+ if (!strncmp(str, "random", 6)) {
+ td->file_service_type = FIO_FSERVICE_RANDOM;
+ return 0;
+ } else if (!strncmp(str, "roundrobin", 10)) {
+ td->file_service_type = FIO_FSERVICE_RR;
+ return 0;
+ }
+
+ log_err("fio: file_service= random, roundrobin\n");
+ return 1;
+}
+
/*
* This is our [ini] type file parser.
*/