up to 100%, the latter of the two will be used to override
the first.
+norandommap Normally fio will cover every block of the file when doing
+ random IO. If this option is given, fio will just get a
+ new random offset without looking at past io history. This
+ means that some blocks may not be read or written, and that
+ some blocks may be read/written more than once. This option
+ is mutually exclusive with verify= for that reason.
+
nice=int Run the job with the given nice value. See man nice(2).
prio=int Set the io priority value of this job. Linux limits us to
#define DEF_UNLINK (0)
#define DEF_WRITE_BW_LOG (0)
#define DEF_WRITE_LAT_LOG (0)
+#define DEF_NO_RAND_MAP (0)
#define td_var_offset(var) ((size_t) &((struct thread_data *)0)->var)
.type = FIO_OPT_STR_SET,
.off1 = td_var_offset(write_lat_log),
},
+ {
+ .name = "norandommap",
+ .type = FIO_OPT_STR_SET,
+ .off1 = td_var_offset(norandommap),
+ },
{
.name = NULL,
},
td->max_bs = td->bs;
if (td_read(td) && !td_rw(td))
td->verify = 0;
+
+ if (td->norandommap && td->verify != VERIFY_NONE) {
+ log_err("fio: norandommap given, verify disabled\n");
+ td->verify = VERIFY_NONE;
+ }
}
/*
if (td->rand_repeatable)
seeds[3] = DEF_RANDSEED;
- for_each_file(td, f, i) {
- blocks = (f->file_size + td->min_bs - 1) / td->min_bs;
- num_maps = blocks / BLOCKS_PER_MAP;
- f->file_map = malloc(num_maps * sizeof(long));
- f->num_maps = num_maps;
- memset(f->file_map, 0, num_maps * sizeof(long));
+ if (!td->norandommap) {
+ for_each_file(td, f, i) {
+ blocks = (f->file_size + td->min_bs - 1) / td->min_bs;
+ num_maps = blocks / BLOCKS_PER_MAP;
+ f->file_map = malloc(num_maps * sizeof(long));
+ f->num_maps = num_maps;
+ memset(f->file_map, 0, num_maps * sizeof(long));
+ }
}
os_random_seed(seeds[3], &td->random_state);
def_thread.unlink = DEF_UNLINK;
def_thread.write_bw_log = write_bw_log;
def_thread.write_lat_log = write_lat_log;
+ def_thread.norandommap = DEF_NO_RAND_MAP;
#ifdef FIO_HAVE_DISK_UTIL
def_thread.do_disk_util = 1;
#endif
do {
r = os_random_long(&td->random_state);
b = ((max_blocks - 1) * r / (unsigned long long) (RAND_MAX+1.0));
+ if (td->norandommap)
+ break;
rb = b + (f->file_offset / td->min_bs);
loops--;
} while (!random_map_free(td, f, rb) && loops);
return NULL;
}
- if (!td->read_iolog && !td->sequential)
+ if (!td->read_iolog && !td->sequential && !td->norandommap)
mark_random_map(td, f, io_u);
f->last_pos += io_u->buflen;