Flexible I/O Tester development
 help / color / mirror / Atom feed
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
To: fio@vger.kernel.org
Cc: oberpar@linux.vnet.ibm.com,
	Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
Subject: [patch 2/9] fio: allow general repeatability
Date: Wed, 19 Feb 2014 16:12:28 +0100	[thread overview]
Message-ID: <5304C9DC.2060904@linux.vnet.ibm.com> (raw)
In-Reply-To: <20140219143639.168501090@linux.vnet.ibm.com>

From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>

This patch adds a "allrandrepeat" option similar to the existing randrepeat.
But other than the former option it does not only affect the random I/O 
pattern,
but also all remaining users of randomness as well.

By that e.g. testcases using nrfiles, filesize ranges, blocksizesplit ranges
and so on will stay repeatable across (euqally parametrized) runs as well.
To maintain compatibility the default is off.
Signed-off-by: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
---

[diffstat]
  fio.1     |    8 ++++++--
  init.c    |    6 ++++++
  options.c |    7 +++++++
  3 files changed, 19 insertions(+), 2 deletions(-)


[diff]

--- a/fio.1
+++ b/fio.1
@@ -293,8 +293,12 @@ read, write, and trim are accounted and
  set, the fio will sum the results and report them as "mixed" instead.
  .TP
  .BI randrepeat \fR=\fPbool
-Seed the random number generator in a predictable way so results are 
repeatable
-across runs.  Default: true.
+Seed the random number generator used for random I/O patterns in a 
predictable
+way so the pattern is repeatable across runs.  Default: true.
+.TP
+.BI allrandrepeat \fR=\fPbool
+Seed all random number generators in a predictable way so results are
+repeatable across runs.  Default: false.
  .TP
  .BI randseed \fR=\fPint
  Seed the random number generators based on this seed value, to be able to
--- a/init.c
+++ b/init.c
@@ -751,6 +751,12 @@ static void td_fill_rand_seeds_internal(
   void td_fill_rand_seeds(struct thread_data *td)
  {
+	if (td->o.allrand_repeatable) {
+		for (int i = 0; i < FIO_RAND_NR_OFFS; i++)
+			td->rand_seeds[i] = FIO_RANDSEED * td->thread_number
+			       	+ i;
+	}
+
  	if (td->o.use_os_rand)
  		td_fill_rand_seeds_os(td);
  	else
--- a/options.c
+++ b/options.c
@@ -1784,6 +1784,13 @@ struct fio_option fio_options[FIO_MAX_OP
  		.group	= FIO_OPT_G_RANDOM,
  	},
  	{
+		.name	= "allrandrepeat",
+		.type	= FIO_OPT_BOOL,
+		.off1	= td_var_offset(allrand_repeatable),
+		.help	= "Use repeatable random numbers for everything",
+		.def	= "0",
+	},
+	{
  		.name	= "nrfiles",
  		.lname	= "Number of files",
  		.alias	= "nr_files",



  parent reply	other threads:[~2014-02-19 15:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140219143639.168501090@linux.vnet.ibm.com>
2014-02-19 15:12 ` [patch 1/9] fio: fix job clone mem leak Christian Ehrhardt
2014-02-19 15:12 ` Christian Ehrhardt [this message]
2014-02-19 15:12 ` [patch 3/9] fio: allow milliseconds on all time specifiers Christian Ehrhardt
2014-02-19 15:12 ` [patch 4/9] fio: provide an option for a startdelay range Christian Ehrhardt
2014-02-19 15:12 ` [patch 5/9] fio: add multi directory support Christian Ehrhardt
2014-02-19 15:12 ` [patch 6/9] fio: allow to combine terse output with any selected output type Christian Ehrhardt
2014-02-19 15:12 ` [patch 7/9] fio: flush log files on test end Christian Ehrhardt
2014-02-19 15:12 ` [patch 8/9] fio: fix last block never being touched by random offsets Christian Ehrhardt
2014-02-19 15:12 ` [patch 9/9] fio: allow 0 as compress percentage Christian Ehrhardt
2014-02-20 13:20 [patch 2/9] fio: allow general repeatability ehrhardt
2014-02-20 17:05 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5304C9DC.2060904@linux.vnet.ibm.com \
    --to=ehrhardt@linux.vnet.ibm.com \
    --cc=fio@vger.kernel.org \
    --cc=oberpar@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox