Recent changes (master)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The following changes since commit 1b8c5af7ba80122c91dce457e18c55b34e2c28b1:

  Update README to reflect that fio now runs on OpenBSD (2013-12-29 19:42:06 -0700)

are available in the git repository at:
  git://git.kernel.dk/fio.git master

Jens Axboe (1):
      Add option to manually seed the random generators

 HOWTO            |    5 +++++
 cconv.c          |    2 ++
 fio.1            |    5 +++++
 init.c           |   15 +++++++++++++--
 options.c        |   10 ++++++++++
 server.h         |    2 +-
 thread_options.h |    2 ++
 7 files changed, 38 insertions(+), 3 deletions(-)

---

Diff of recent changes:

diff --git a/HOWTO b/HOWTO
index 044b572..2183be1 100644
--- a/HOWTO
+++ b/HOWTO
@@ -384,6 +384,11 @@ unified_rw_reporting=bool	Fio normally reports statistics on a per
 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
diff --git a/cconv.c b/cconv.c
index dd61d10..3a6880a 100644
--- a/cconv.c
+++ b/cconv.c
@@ -118,6 +118,7 @@ void convert_thread_options_to_cpu(struct thread_options *o,
 	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);
@@ -282,6 +283,7 @@ void convert_thread_options_to_net(struct thread_options_pack *top,
 	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);
diff --git a/fio.1 b/fio.1
index 9ee0eef..6c3dd21 100644
--- a/fio.1
+++ b/fio.1
@@ -288,6 +288,11 @@ set, the fio will sum the results and report them as "mixed" instead.
 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).
diff --git a/init.c b/init.c
index ba22f78..af0bb2d 100644
--- a/init.c
+++ b/init.c
@@ -635,6 +635,12 @@ static int fixup_options(struct thread_data *td)
 	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;
 }
 
@@ -830,10 +836,15 @@ static int setup_random_seeds(struct thread_data *td)
 	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++) {
diff --git a/options.c b/options.c
index b0f4509..16b6636 100644
--- a/options.c
+++ b/options.c
@@ -1627,6 +1627,16 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
 		.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",
 		.type	= FIO_OPT_BOOL,
diff --git a/server.h b/server.h
index 84901cf..0416fd7 100644
--- a/server.h
+++ b/server.h
@@ -38,7 +38,7 @@ struct fio_net_cmd_reply {
 };
 
 enum {
-	FIO_SERVER_VER			= 28,
+	FIO_SERVER_VER			= 29,
 
 	FIO_SERVER_MAX_FRAGMENT_PDU	= 1024,
 
diff --git a/thread_options.h b/thread_options.h
index 7476d8c..e2c6e88 100644
--- a/thread_options.h
+++ b/thread_options.h
@@ -100,6 +100,7 @@ struct thread_options {
 	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;
@@ -319,6 +320,7 @@ struct thread_options_pack {
 	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;
--
To unsubscribe from this list: send the line "unsubscribe fio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux