From: Vincent Fu <vincentfu@gmail.com>
To: Ankit Kumar <ankit.kumar@samsung.com>, axboe@kernel.dk
Cc: fio@vger.kernel.org
Subject: Re: [PATCH 1/2] io_u: fix offset generation for mix of random and sequential workload
Date: Mon, 28 Nov 2022 16:57:28 -0500 [thread overview]
Message-ID: <1d29e8c8-ce79-0608-d979-d50bfbc9e112@gmail.com> (raw)
In-Reply-To: <20221118051454.31288-2-ankit.kumar@samsung.com>
On 11/18/22 00:14, Ankit Kumar wrote:
> Sometimes while running a mix of sequential and random I/O's the
> generated sequential offset is outside the I/O region. This usually
> happens if the previous I/O is the last block in the region and
> thus results in this sequential I/O's offset to be just outside the
> region.
> With this fix, fio generates a random offset within the I/O region.
>
> This fixes #1486
>
> Signed-off-by: Ankit Kumar <ankit.kumar@samsung.com>
> ---
> io_u.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/io_u.c b/io_u.c
> index 8035f4b7..e49b1b29 100644
> --- a/io_u.c
> +++ b/io_u.c
> @@ -432,8 +432,11 @@ static int get_next_block(struct thread_data
*td, struct io_u *io_u,
> *is_random = false;
> io_u_set(td, io_u, IO_U_F_BUSY_OK);
> ret = get_next_seq_offset(td, f, ddir, &offset);
> - if (ret)
> + if (ret || offset >= f->io_size) {
> ret = get_next_rand_block(td, f, ddir, &b);
> + offset = -1ULL;
> + *is_random = true;
> + }
> }
> } else {
> *is_random = false;
This patch causes a regression with a workload such as:
fio --name=test --bs=4k --filesize=32k --nrfiles=10 --number_ios=10
--file_service_type=sequential --percentage_random=50 --rw=randread
--randrepeat=0 --ioengine=null --debug=io
Only the first file will be accessed when this patch is applied. Bad
offsets are needed in order to trigger the move to the next file.
Here is a related issue: https://github.com/axboe/fio/issues/1372
Perhaps the right thing to do is to limit the offset >= f->io_size check
to cases where nrfiles = 1 as in the patch for issue 1372.
Also, it seems to me that if we are intending to generate a sequential
offset for this case and succeed in doing so, we should just wrap around
to the beginning of the file instead of choosing a new random offset.
In general we have an overwhelming set of ways to generate offsets and
little automated testing for offset generation. In the long run we
should develop a set of tests for offset generation that exercise the
different options. This will help us detect issues and give us
confidence that future code changes won't introduce regressions.
Vincent
next prev parent reply other threads:[~2022-11-28 21:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20221118052632epcas5p48ffea1e5c9b88f99b2bc90147e93321d@epcas5p4.samsung.com>
2022-11-18 5:14 ` [PATCH 0/2] Fix percentage random workload and add test case Ankit Kumar
2022-11-18 5:14 ` [PATCH 1/2] io_u: fix offset generation for mix of random and sequential workload Ankit Kumar
2022-11-28 21:57 ` Vincent Fu [this message]
2022-11-30 10:50 ` Ankit Kumar
2022-11-30 19:10 ` Vincent Fu
2022-11-18 5:14 ` [PATCH 2/2] test: add test for mix " Ankit Kumar
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=1d29e8c8-ce79-0608-d979-d50bfbc9e112@gmail.com \
--to=vincentfu@gmail.com \
--cc=ankit.kumar@samsung.com \
--cc=axboe@kernel.dk \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.