From: Jens Axboe <axboe@kernel.dk>
To: Juan Casse <jcasse@chromium.org>
Cc: Grant Grundler <grundler@chromium.org>, fio@vger.kernel.org
Subject: Re: [PATCH] Adds verify_only option.
Date: Fri, 06 Sep 2013 08:46:34 -0600 [thread overview]
Message-ID: <5229EACA.7090009@kernel.dk> (raw)
In-Reply-To: <1378437152-11128-1-git-send-email-jcasse@chromium.org>
On 09/05/2013 09:12 PM, Juan Casse wrote:
> The verify_only option allows to correctly verify the numberio in each
> block header that was written in a previous run of fio.
Comments inline.
> diff --git a/engines/sync.c b/engines/sync.c
> index 1329946..9dbd857 100644
> --- a/engines/sync.c
> +++ b/engines/sync.c
> @@ -125,8 +125,12 @@ static int fio_syncio_queue(struct thread_data *td, struct io_u *io_u)
>
> if (io_u->ddir == DDIR_READ)
> ret = read(f->fd, io_u->xfer_buf, io_u->xfer_buflen);
> - else if (io_u->ddir == DDIR_WRITE)
> - ret = write(f->fd, io_u->xfer_buf, io_u->xfer_buflen);
> + else if (io_u->ddir == DDIR_WRITE) {
> + if (!td->o.verify_only)
> + ret = write(f->fd, io_u->xfer_buf, io_u->xfer_buflen);
> + else
> + ret = io_u->xfer_buflen;
> + }
Ugh what? This is completely the wrong place to do this. The fact that
you are also doing this:
> + /*
> + * The verify_only option implies that we want to do a verify of the
> + * meta data in each block written in a previous run using the
> + * same workload. We still need to simulate the workload
> + * (without actually writing) in order to compute the numberio that
> + * would have been written to the meta section of each block.
> + * We revert to the the synchronous io engine because there is already
> + * code in place for the synchronous engine to compute the numberio
> + * without writing to disk.
> + */
> + if (o->verify_only) {
> + o->do_verify = 1;
> + o->verify = VERIFY_META;
> + strcpy(o->ioengine, "sync");
> + }
Should be a clear warning sign! You are hard coding the verify type and
the engine, why??
Please take a look at how this is done for the experimental_verify. The
writes are skipped much sooner and generically, there's no need to
enforce any sort of specific IO engine or verify type.
--
Jens Axboe
next prev parent reply other threads:[~2013-09-06 14:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-06 3:12 [PATCH] Adds verify_only option Juan Casse
2013-09-06 14:46 ` Jens Axboe [this message]
2013-09-06 17:15 ` Grant Grundler
2013-09-06 23:31 ` Juan Casse
2013-09-08 1:32 ` Jens Axboe
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=5229EACA.7090009@kernel.dk \
--to=axboe@kernel.dk \
--cc=fio@vger.kernel.org \
--cc=grundler@chromium.org \
--cc=jcasse@chromium.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