aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2022-09-28 09:11:41 -0600
committerJens Axboe <axboe@kernel.dk>2022-09-28 09:29:17 -0600
commit42bbfa0a334440f1fc1fcba399bba65df20f655c (patch)
treedcb83e6402fc2637df29a631010ea3b66d306f17
parentc5f0a205e9bf205d71ed015aa2be0b9e24b0e756 (diff)
downloadfio-randtrimwrite.tar.gz
Add randtrimwrite data directionrandtrimwrite
This works like trimwrite, except we use random offsets for the trim location rather than sequential ones. Suggested-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--HOWTO.rst3
-rw-r--r--fio.15
-rw-r--r--io_ddir.h4
-rw-r--r--options.c4
4 files changed, 15 insertions, 1 deletions
diff --git a/HOWTO.rst b/HOWTO.rst
index 924f5ed95..e89d05f04 100644
--- a/HOWTO.rst
+++ b/HOWTO.rst
@@ -1134,6 +1134,9 @@ I/O type
write 64K bytes on the same trimmed blocks. This behaviour
will be consistent with ``number_ios`` or other Fio options
limiting the total bytes or number of I/O's.
+ **randtrimwrite**
+ Like trimwrite, but uses random offsets rather
+ than sequential writes.
Fio defaults to read if the option is not specified. For the mixed I/O
types, the default is to split them 50/50. For certain types of I/O the
diff --git a/fio.1 b/fio.1
index 39d6b4f49..4324a9750 100644
--- a/fio.1
+++ b/fio.1
@@ -904,6 +904,11 @@ then the same blocks will be written to. So if `io_size=64K' is specified,
Fio will trim a total of 64K bytes and also write 64K bytes on the same
trimmed blocks. This behaviour will be consistent with `number_ios' or
other Fio options limiting the total bytes or number of I/O's.
+.TP
+.B randtrimwrite
+Like
+.B trimwrite ,
+but uses random offsets rather than sequential writes.
.RE
.P
Fio defaults to read if the option is not specified. For the mixed I/O
diff --git a/io_ddir.h b/io_ddir.h
index 296a9d04a..7227e9ee7 100644
--- a/io_ddir.h
+++ b/io_ddir.h
@@ -41,6 +41,7 @@ enum td_ddir {
TD_DDIR_RANDRW = TD_DDIR_RW | TD_DDIR_RAND,
TD_DDIR_RANDTRIM = TD_DDIR_TRIM | TD_DDIR_RAND,
TD_DDIR_TRIMWRITE = TD_DDIR_TRIM | TD_DDIR_WRITE,
+ TD_DDIR_RANDTRIMWRITE = TD_DDIR_RANDTRIM | TD_DDIR_WRITE,
};
#define td_read(td) ((td)->o.td_ddir & TD_DDIR_READ)
@@ -67,7 +68,8 @@ static inline const char *ddir_str(enum td_ddir ddir)
{
static const char *__str[] = { NULL, "read", "write", "rw", "rand",
"randread", "randwrite", "randrw",
- "trim", NULL, "trimwrite", NULL, "randtrim" };
+ "trim", NULL, "trimwrite", NULL, "randtrim",
+ NULL, "randtrimwrite" };
return __str[ddir];
}
diff --git a/options.c b/options.c
index 5d3daedf3..a668b0e47 100644
--- a/options.c
+++ b/options.c
@@ -1947,6 +1947,10 @@ struct fio_option fio_options[FIO_MAX_OPTS] = {
.oval = TD_DDIR_TRIMWRITE,
.help = "Trim and write mix, trims preceding writes"
},
+ { .ival = "randtrimwrite",
+ .oval = TD_DDIR_RANDTRIMWRITE,
+ .help = "Randomly trim and write mix, trims preceding writes"
+ },
},
},
{