* [patch 2/9] fio: allow general repeatability
@ 2014-02-20 13:20 ehrhardt
2014-02-20 17:05 ` Jens Axboe
0 siblings, 1 reply; 3+ messages in thread
From: ehrhardt @ 2014-02-20 13:20 UTC (permalink / raw)
To: fio; +Cc: oberpar, Christian Ehrhardt
*Resend with hopefully non mangled patches*
References: <20140220131958.965092001@linux.vnet.ibm.com>
Content-Disposition: inline; filename=repeatable-global-randomness.diff
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",
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [patch 2/9] fio: allow general repeatability
2014-02-20 13:20 [patch 2/9] fio: allow general repeatability ehrhardt
@ 2014-02-20 17:05 ` Jens Axboe
0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2014-02-20 17:05 UTC (permalink / raw)
To: ehrhardt; +Cc: fio, oberpar
On Thu, Feb 20 2014, ehrhardt@linux.vnet.ibm.com wrote:
> *Resend with hopefully non mangled patches*
> References: <20140220131958.965092001@linux.vnet.ibm.com>
> Content-Disposition: inline; filename=repeatable-global-randomness.diff
>
> 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.
Forgot the thread_options.h change here too. Also note that you need to
update cconv.c as well when adding options.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20140219143639.168501090@linux.vnet.ibm.com>]
* [patch 2/9] fio: allow general repeatability
[not found] <20140219143639.168501090@linux.vnet.ibm.com>
@ 2014-02-19 15:12 ` Christian Ehrhardt
0 siblings, 0 replies; 3+ messages in thread
From: Christian Ehrhardt @ 2014-02-19 15:12 UTC (permalink / raw)
To: fio; +Cc: oberpar, Christian Ehrhardt
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",
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-02-20 17:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-20 13:20 [patch 2/9] fio: allow general repeatability ehrhardt
2014-02-20 17:05 ` Jens Axboe
[not found] <20140219143639.168501090@linux.vnet.ibm.com>
2014-02-19 15:12 ` Christian Ehrhardt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox