From: Jens Axboe <axboe@kernel.dk>
To: Andrey Kuzmin <andrey.v.kuzmin@gmail.com>
Cc: "fio@vger.kernel.org" <fio@vger.kernel.org>
Subject: Re: io_size vs. time_based discrepancy
Date: Mon, 30 Nov 2015 10:19:17 -0700 [thread overview]
Message-ID: <565C8515.40200@kernel.dk> (raw)
In-Reply-To: <CANvN+e=pcwpAMe0U_UhpLKAR1Rrt8uM9T3b7CrLqFjZZMb8XaQ@mail.gmail.com>
On 11/30/2015 03:52 AM, Andrey Kuzmin wrote:
> I'm witnessing an annoying discrepancy between the outcome of the same
> job when being run as io_size-based vs. time_based. In the former
> mode, the job does exactly what I want it to do, writing the
> prescribed amount of data randomly w/o being concerned whether that
> total bytes written is in any way related to the target file size.
>
> On the contrary, in the latter mode that same job, after writing the
> file's size worth of bytes, resets random generator and essentially
> restarts the just completed loop. The offending code is below, and the
> suggested fix brings back home the io_size-like behavior when running
> time-based. Nonetheless, I'm in doubt regarding whether the do_io loop
> break-out below was intended to support the designed behavior (looks
> unlikely to me, as looping like that is produced by the 'loops'
> option, although time_based definition under HOWTO is rather unclear
> in this regard) or is a bug worth fixing.
>
> Regards,
> Andrey
>
> diff --git a/backend.c b/backend.c
> index 4e192e3..c7584a0 100644
> --- a/backend.c
> +++ b/backend.c
> @@ -868,7 +868,7 @@ static uint64_t do_io(struct thread_data *td)
> if (flow_threshold_exceeded(td))
> continue;
>
> - if (bytes_issued >= total_bytes)
> + if (!td->o.time_based && bytes_issued >= total_bytes)
> break;
>
> io_u = get_io_u(td);
I think the patch is fine. The general worry is that we get stuck in a
loop not finding new work, but the get_io_u() should bail out for that
case for us. I'll apply your patch, thanks.
--
Jens Axboe
prev parent reply other threads:[~2015-11-30 17:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-30 10:52 io_size vs. time_based discrepancy Andrey Kuzmin
2015-11-30 17:19 ` Jens Axboe [this message]
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=565C8515.40200@kernel.dk \
--to=axboe@kernel.dk \
--cc=andrey.v.kuzmin@gmail.com \
--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.