From: Taisuke Yamada <tai@rakugaki.org>
To: fio@vger.kernel.org
Subject: [PATCH 1/2] Added replay_rebase option to run multi-threaded log replay on different disk sectors.
Date: Fri, 09 Sep 2011 14:12:40 +0900 [thread overview]
Message-ID: <4E69A048.6050509@rakugaki.org> (raw)
[-- Attachment #1: Type: text/plain, Size: 711 bytes --]
Hi.
I'm now trying to run multi-threaded log replay, and noticed
all threads are accessing same sector on a disk. Of course,
this is an expected behavior of "replay".
But since I also wanted to have each thread accessing different
parts of the disk to increase a load, but still following the
access pattern of the original, I added "replay_rebase" option to
shift offset of IO request for each thread.
Althrough there's "1/2" in the subject, this patch is complete
by itself. Next one (2/2) is related, but handles different issue.
Signed-off-by: Taisuke Yamada <tai@rakugaki.org>
---
fio.h | 1 +
log.c | 2 +-
options.c | 8 ++++++++
3 files changed, 10 insertions(+), 1 deletions(-)
[-- Attachment #2: 0001-Added-replay_rebase-option-to-run-multi-threaded-log.patch --]
[-- Type: text/x-patch, Size: 1318 bytes --]
diff --git a/fio.h b/fio.h
index 6eb270d..b28e0ae 100644
--- a/fio.h
+++ b/fio.h
@@ -358,6 +358,7 @@ struct thread_options {
unsigned int gtod_offload;
enum fio_cs clocksource;
unsigned int no_stall;
+ unsigned int replay_rebase;
unsigned int trim_percentage;
unsigned int trim_batch;
unsigned int trim_zero;
diff --git a/log.c b/log.c
index f962864..57fc0f4 100644
--- a/log.c
+++ b/log.c
@@ -129,7 +129,7 @@ int read_iolog_get(struct thread_data *td, struct io_u *io_u)
io_u->ddir = ipo->ddir;
if (ipo->ddir != DDIR_WAIT) {
- io_u->offset = ipo->offset;
+ io_u->offset = ipo->offset + td->o.replay_rebase * td->thread_number;
io_u->buflen = ipo->len;
io_u->file = td->files[ipo->fileno];
get_file(io_u->file);
diff --git a/options.c b/options.c
index 74c24d0..aba14b1 100644
--- a/options.c
+++ b/options.c
@@ -1654,6 +1654,14 @@ static struct fio_option options[FIO_MAX_OPTS] = {
.help = "Replay all I/O onto this device, regardless of trace device",
},
{
+ .name = "replay_rebase",
+ .type = FIO_OPT_INT,
+ .off1 = td_var_offset(replay_rebase),
+ .def = "0",
+ .parent = "read_iolog",
+ .help = "Apply given offset for IO replay. Mainly for parallel replay.",
+ },
+ {
.name = "exec_prerun",
.type = FIO_OPT_STR_STORE,
.off1 = td_var_offset(exec_prerun),
next reply other threads:[~2011-09-09 5:27 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-09 5:12 Taisuke Yamada [this message]
2011-09-09 8:37 ` [PATCH 1/2] Added replay_rebase option to run multi-threaded log replay on different disk sectors Jens Axboe
2011-09-15 6:23 ` Taisuke Yamada
2011-09-15 11:10 ` Jens Axboe
2011-09-15 11:52 ` Taisuke Yamada
2011-09-15 11:14 ` Jens Axboe
2011-09-15 11:40 ` Taisuke Yamada
2011-09-15 11:42 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2011-09-12 5:30 Taisuke Yamada
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=4E69A048.6050509@rakugaki.org \
--to=tai@rakugaki.org \
--cc=fio@vger.kernel.org \
/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