randrepeat=bool For random IO workloads, seed the generator in a predictable
way so that results are repeatable across repetitions.
+randseed=int Seed the random number generators based on this seed value, to
+ be able to control what sequence of output is being generated.
+ If not set, the random sequence depends on the randrepeat
+ setting.
+
use_os_rand=bool Fio can either use the random generator supplied by the OS
to generator random offsets, or it can use it's own internal
generator (based on Tausworthe). Default is to use the
o->do_disk_util = le32_to_cpu(top->do_disk_util);
o->override_sync = le32_to_cpu(top->override_sync);
o->rand_repeatable = le32_to_cpu(top->rand_repeatable);
+ o->rand_seed = le32_to_cpu(top->rand_seed);
o->use_os_rand = le32_to_cpu(top->use_os_rand);
o->log_avg_msec = le32_to_cpu(top->log_avg_msec);
o->norandommap = le32_to_cpu(top->norandommap);
top->do_disk_util = cpu_to_le32(o->do_disk_util);
top->override_sync = cpu_to_le32(o->override_sync);
top->rand_repeatable = cpu_to_le32(o->rand_repeatable);
+ top->rand_seed = cpu_to_le32(o->rand_seed);
top->use_os_rand = cpu_to_le32(o->use_os_rand);
top->log_avg_msec = cpu_to_le32(o->log_avg_msec);
top->norandommap = cpu_to_le32(o->norandommap);
Seed the random number generator in a predictable way so results are repeatable
across runs. Default: true.
.TP
+.BI randseed \fR=\fPint
+Seed the random number generators based on this seed value, to be able to
+control what sequence of output is being generated. If not set, the random
+sequence depends on the \fBrandrepeat\fR setting.
+.TP
.BI use_os_rand \fR=\fPbool
Fio can either use the random generator supplied by the OS to generator random
offsets, or it can use it's own internal generator (based on Tausworthe).
if (td->o.oatomic)
td->o.odirect = 1;
+ /*
+ * If randseed is set, that overrides randrepeat
+ */
+ if (td->o.rand_seed)
+ td->o.rand_repeatable = 0;
+
return ret;
}
unsigned long seed;
unsigned int i;
- if (!td->o.rand_repeatable)
+ if (!td->o.rand_repeatable && !td->o.rand_seed)
return init_random_state(td, td->rand_seeds, sizeof(td->rand_seeds));
- for (seed = 0x89, i = 0; i < 4; i++)
+ if (!td->o.rand_seed)
+ seed = 0x89;
+ else
+ seed = td->o.rand_seed;
+
+ for (i = 0; i < 4; i++)
seed *= 0x9e370001UL;
for (i = 0; i < FIO_RAND_NR_OFFS; i++) {
.category = FIO_OPT_C_IO,
.group = FIO_OPT_G_RANDOM,
},
+ {
+ .name = "randseed",
+ .lname = "The random generator seed",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(rand_seed),
+ .help = "Set the random generator seed value",
+ .parent = "rw",
+ .category = FIO_OPT_C_IO,
+ .group = FIO_OPT_G_RANDOM,
+ },
{
.name = "use_os_rand",
.lname = "Use OS random",
};
enum {
- FIO_SERVER_VER = 28,
+ FIO_SERVER_VER = 29,
FIO_SERVER_MAX_FRAGMENT_PDU = 1024,
unsigned int do_disk_util;
unsigned int override_sync;
unsigned int rand_repeatable;
+ unsigned int rand_seed;
unsigned int use_os_rand;
unsigned int log_avg_msec;
unsigned int norandommap;
uint32_t do_disk_util;
uint32_t override_sync;
uint32_t rand_repeatable;
+ uint32_t rand_seed;
uint32_t use_os_rand;
uint32_t log_avg_msec;
uint32_t norandommap;